Gorilla.SkyBox
Unit Gorilla.SkyBox.pasClasses
- TGorillaSkyBoxMaterial = class ( TCustomMaterial )
- TGorillaSkyBoxMaterialSource = class ( TMaterialSource )
- TGorillaSkyBox = class ( TGorillaCube )
Records
- record TSkyBoxShaderData
Enumerations
- enum TGorillaSkyBoxMode = ( CubeMapSkyBox, ProceduralSkyBox, Blank ) ;
Constants
Mics. types
- type PSkyBoxShaderData = pointer to TSkyBoxShaderData;
TSkyBoxShaderData
Fields
- public ModelViewProjMatrix :
TMatrix3D
- public ModelMatrix :
TMatrix3D
- public ViewMatrix :
TMatrix3D
- public ProjMatrix :
TMatrix3D
- public TimeInfo :
TVector3D
- public EyePos :
TVector3D
- public Diffuse :
TAlphaColorF
- public Emissive :
TAlphaColorF
- public Resolution :
TVector3D
- public CrescentOfs :
TPointF
- public CrescentMoon :
Single
- public MoonSurface :
Single
- public DepolarizationFactor :
Single
- public Luminance :
Single
- public MieCoefficient :
Single
- public MieDirectionalG :
Single
- public MieV :
Single
- public MieZenithLength :
Single
- public Reserve1 :
- public MieKCoefficient :
TVector3D
- public Primaries :
TPoint3D
- public NumMolecules :
Single
- public Rayleigh :
Single
- public RayleighZenithLength :
Single
- public RefractiveIndex :
Single
- public SunAngularDiameterDegrees :
Single
- public SunIntensityFactor :
Single
- public SunIntensityFalloffSteepness :
Single
- public TonemapWeighting :
Single
- public Turbidity :
Single
- public Inclination :
Single
- public Azimuth :
Single
- public StarDensity :
Single
- public StarProbe :
Single
- public StarSize :
Single
- public StarSpark :
Single
- public StarBrightness :
Single
- public Reserve2 :
Single
- public StarColor :
TAlphaColorF
- public CloudColor :
TAlphaColorF
- public CloudIterations :
Integer
- public CloudFrequency :
Single
- public CloudAmplitude :
Single
- public FogMode :
Integer
- public FogDensity :
Single
- public FogStart :
Single
- public FogEnd :
Single
- public Reserve3 :
Single
- public FogColor :
TAlphaColorF
Methods
TGorillaSkyBoxMaterial
Ancestors
Members
Fields
- protected FSource :
TGorillaSkyBoxMaterialSource
- protected FMode :
TGorillaSkyBoxMode
- protected FCubeMap :
TTexture
- protected FAllowFog :
Boolean
- protected FShaderData :
TSkyBoxShaderData
- protected FShaderDataRegistered :
Boolean
- protected FPrevVS :
TContextShader
- protected FPrevFS :
TContextShader
- protected FVertexShader2 :
TContextShader
- protected FPixelShader2 :
TContextShader
- protected FPixelShader3 :
TContextShader
Methods
- public constructor Create ( const ASource : TGorillaSkyBoxMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected procedure SetCubeMap ( const AValue : TTexture ) ;
- protected procedure DoUpdateShaderUniformBuffers ( const Context : TContext3D; AProgram : TShaderProgram ) ;
- protected function GetAzimuth ( ) : Single ;
- protected function GetCloudAmplitude ( ) : Single ;
- protected function GetCloudColor ( ) : TAlphaColorF ;
- protected function GetCloudFrequency ( ) : Single ;
- protected function GetCloudIterations ( ) : Integer ;
- protected function GetCrescentMoon ( ) : Single ;
- protected function GetCrescent ( ) : Boolean ;
- protected function GetCrescentOfs ( ) : TPointF ;
- protected function GetDepolarizationFactor ( ) : Single ;
- protected function GetDiffuse ( ) : TAlphaColorF ;
- protected function GetEmissive ( ) : TAlphaColorF ;
- protected function GetInclination ( ) : Single ;
- protected function GetLuminance ( ) : Single ;
- protected function GetMieCoefficient ( ) : Single ;
- protected function GetMieDirectionalG ( ) : Single ;
- protected function GetMieKCoefficient ( ) : TVector3D ;
- protected function GetMieV ( ) : Single ;
- protected function GetMieZenithLength ( ) : Single ;
- protected function GetMoonSurface ( ) : Single ;
- protected function GetNumMolecules ( ) : Single ;
- protected function GetPrimaries ( ) : TPoint3D ;
- protected function GetRayleigh ( ) : Single ;
- protected function GetRayleighZenithLength ( ) : Single ;
- protected function GetRefractiveIndex ( ) : Single ;
- protected function GetStarBrightness ( ) : Single ;
- protected function GetStarColor ( ) : TAlphaColorF ;
- protected function GetStarDensity ( ) : Single ;
- protected function GetStarProbe ( ) : Single ;
- protected function GetStarSize ( ) : Single ;
- protected function GetStarSpark ( ) : Single ;
- protected function GetSunAngularDiameterDegrees ( ) : Single ;
- protected function GetSunIntensityFactor ( ) : Single ;
- protected function GetSunIntensityFalloffSteepness ( ) : Single ;
- protected function GetTonemapWeighting ( ) : Single ;
- protected function GetTurbidity ( ) : Single ;
- protected procedure SetAzimuth ( const AValue : Single ) ;
- protected procedure SetCloudAmplitude ( const AValue : Single ) ;
- protected procedure SetCloudColor ( const AValue : TAlphaColorF ) ;
- protected procedure SetCloudFrequency ( const AValue : Single ) ;
- protected procedure SetCloudIterations ( const AValue : Integer ) ;
- protected procedure SetCrescentMoon ( const AValue : Single ) ;
- protected procedure SetCrescent ( const AValue : Boolean ) ;
- protected procedure SetCrescentOfs ( const AValue : TPointF ) ;
- protected procedure SetDepolarizationFactor ( const AValue : Single ) ;
- protected procedure SetDiffuse ( const AValue : TAlphaColorF ) ;
- protected procedure SetEmissive ( const AValue : TAlphaColorF ) ;
- protected procedure SetInclination ( const AValue : Single ) ;
- protected procedure SetLuminance ( const AValue : Single ) ;
- protected procedure SetMieCoefficient ( const AValue : Single ) ;
- protected procedure SetMieDirectionalG ( const AValue : Single ) ;
- protected procedure SetMieKCoefficient ( const AValue : TVector3D ) ;
- protected procedure SetMieV ( const AValue : Single ) ;
- protected procedure SetMieZenithLength ( const AValue : Single ) ;
- protected procedure SetMoonSurface ( const AValue : Single ) ;
- protected procedure SetNumMolecules ( const AValue : Single ) ;
- protected procedure SetPrimaries ( const AValue : TPoint3D ) ;
- protected procedure SetRayleigh ( const AValue : Single ) ;
- protected procedure SetRayleighZenithLength ( const AValue : Single ) ;
- protected procedure SetRefractiveIndex ( const AValue : Single ) ;
- protected procedure SetStarBrightness ( const AValue : Single ) ;
- protected procedure SetStarColor ( const AValue : TAlphaColorF ) ;
- protected procedure SetStarDensity ( const AValue : Single ) ;
- protected procedure SetStarProbe ( const AValue : Single ) ;
- protected procedure SetStarSize ( const AValue : Single ) ;
- protected procedure SetStarSpark ( const AValue : Single ) ;
- protected procedure SetSunAngularDiameterDegrees ( const AValue : Single ) ;
- protected procedure SetSunIntensityFactor ( const AValue : Single ) ;
- protected procedure SetSunIntensityFalloffSteepness ( const AValue : Single ) ;
- protected procedure SetTonemapWeighting ( const AValue : Single ) ;
- protected procedure SetTurbidity ( const AValue : Single ) ;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoInitialize ( ) ; override;
Properties
- public Mode : TGorillaSkyBoxMode
- public CubeMap : TTexture
- public AllowFog : Boolean
- public Diffuse : TAlphaColorF
- public Emissive : TAlphaColorF
- public CrescentOfs : TPointF
- public CrescentMoon : Single
- public Crescent : Boolean
- public MoonSurface : Single
- public DepolarizationFactor : Single
- public Luminance : Single
- public MieCoefficient : Single
- public MieDirectionalG : Single
- public MieV : Single
- public MieZenithLength : Single
- public MieKCoefficient : TVector3D
- public Primaries : TPoint3D
- public NumMolecules : Single
- public Rayleigh : Single
- public RayleighZenithLength : Single
- public RefractiveIndex : Single
- public SunAngularDiameterDegrees : Single
- public SunIntensityFactor : Single
- public SunIntensityFalloffSteepness : Single
- public TonemapWeighting : Single
- public Turbidity : Single
- public Inclination : Single
- public Azimuth : Single
- public StarDensity : Single
- public StarProbe : Single
- public StarSize : Single
- public StarSpark : Single
- public StarBrightness : Single
- public StarColor : TAlphaColorF
- public CloudColor : TAlphaColorF
- public CloudIterations : Integer
- public CloudFrequency : Single
- public CloudAmplitude : Single
TGorillaSkyBoxMaterialSource
Ancestors
Members
Fields
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function CreateMaterial ( ) : TMaterial ; override;
- protected procedure DoCubeMapChanged ( Sender : TObject ) ;
- protected procedure ContextResetHandlerOverride ( const Sender : TObject; const Msg : TMessageBase ) ;
- protected function GetMode ( ) : TGorillaSkyBoxMode ;
- protected procedure SetMode ( const AValue : TGorillaSkyBoxMode ) ;
- protected function GetCubeMap ( ) : TGorillaTextureBitmap ;
- protected procedure SetCubeMap ( AValue : TGorillaTextureBitmap ) ;
- protected function GetAllowFog ( ) : Boolean ;
- protected procedure SetAllowFog ( AValue : Boolean ) ;
- protected function GetDiffuse ( ) : TAlphaColorF ;
- protected procedure SetDiffuse ( const AValue : TAlphaColorF ) ;
- protected function GetEmissive ( ) : TAlphaColorF ;
- protected procedure SetEmissive ( const AValue : TAlphaColorF ) ;
Properties
TGorillaSkyBox
Custom skybox component which can be used to display a sky or an environment rendered from texture.
Remarks
The component DO NOT use CubeMap technology yet. This is a feature for future releases and should remove tiny border spaces during rendering. At the moment 6 planes are generated and rendered with a single texture for each side.Ancestors
Members
Fields
- protected FSubdivisionsAxes :
Integer
- protected FSubdivisionsHeight :
Integer
- protected FDoUpdateCubeMap :
Boolean
- protected FTextures :
- protected FMaterial :
TGorillaSkyBoxMaterialSource
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetMode ( ) : TGorillaSkyBoxMode ;
- protected procedure SetMode ( const AValue : TGorillaSkyBoxMode ) ;
- protected function GetSize ( ) : TPoint3D ;
- protected procedure SetSize ( const AValue : TPoint3D ) ;
- protected function GetTexture ( AIndex : TGorillaCubeMapFace ) : TBitmap ;
- protected procedure SetTexture ( AIndex : TGorillaCubeMapFace; const AValue : TBitmap ) ;
- protected function GetAllowFog ( ) : Boolean ;
- protected procedure SetAllowFog ( AValue : Boolean ) ;
- protected procedure DoCubeMapChanged ( Sender : TObject ) ;
- protected procedure CreateTextures ( ) ; virtual;
- protected procedure DestroyTextures ( ) ; virtual;
- protected procedure DoUpdateCubeMap ( ) ; virtual;
- protected procedure DoRebuildSphereMesh ( AIsStatic : Boolean = True ) ;
- protected procedure Render
(
)
;
override;
Override the internal render method to initialize planes and materials.
- protected function GetAzimuth ( ) : Single ;
- protected function GetCloudAmplitude ( ) : Single ;
- protected function GetCloudColor ( ) : TAlphaColor ;
- protected function GetCloudFrequency ( ) : Single ;
- protected function GetCloudIterations ( ) : Integer ;
- protected function GetCrescentMoon ( ) : Single ;
- protected function GetCrescent ( ) : Boolean ;
- protected function GetCrescentOfs ( ) : TPointF ;
- protected function GetCrescentOfsX ( ) : Single ;
- protected function GetCrescentOfsY ( ) : Single ;
- protected function GetDepolarizationFactor ( ) : Single ;
- protected function GetDiffuse ( ) : TAlphaColor ;
- protected function GetEmissive ( ) : TAlphaColor ;
- protected function GetInclination ( ) : Single ;
- protected function GetLuminance ( ) : Single ;
- protected function GetMieCoefficient ( ) : Single ;
- protected function GetMieDirectionalG ( ) : Single ;
- protected function GetMieKCoefficient ( ) : TVector3D ;
- protected function GetMieKCoefficientByIdx ( AIndex : Integer ) : Single ;
- protected function GetMieV ( ) : Single ;
- protected function GetMieZenithLength ( ) : Single ;
- protected function GetMoonSurface ( ) : Single ;
- protected function GetNumMolecules ( ) : Single ;
- protected function GetPrimaries ( ) : TPoint3D ;
- protected function GetPrimariesByIdx ( AIndex : Integer ) : Single ;
- protected function GetRayleigh ( ) : Single ;
- protected function GetRayleighZenithLength ( ) : Single ;
- protected function GetRefractiveIndex ( ) : Single ;
- protected function GetStarBrightness ( ) : Single ;
- protected function GetStarColor ( ) : TAlphaColor ;
- protected function GetStarDensity ( ) : Single ;
- protected function GetStarProbe ( ) : Single ;
- protected function GetStarSize ( ) : Single ;
- protected function GetStarSpark ( ) : Single ;
- protected function GetSunAngularDiameterDegrees ( ) : Single ;
- protected function GetSunIntensityFactor ( ) : Single ;
- protected function GetSunIntensityFalloffSteepness ( ) : Single ;
- protected function GetTonemapWeighting ( ) : Single ;
- protected function GetTurbidity ( ) : Single ;
- protected procedure SetAzimuth ( const AValue : Single ) ;
- protected procedure SetCloudAmplitude ( const AValue : Single ) ;
- protected procedure SetCloudColor ( const AValue : TAlphaColor ) ;
- protected procedure SetCloudFrequency ( const AValue : Single ) ;
- protected procedure SetCloudIterations ( const AValue : Integer ) ;
- protected procedure SetCrescentMoon ( const AValue : Single ) ;
- protected procedure SetCrescent ( const AValue : Boolean ) ;
- protected procedure SetCrescentOfs ( const AValue : TPointF ) ;
- protected procedure SetCrescentOfsX ( const AValue : Single ) ;
- protected procedure SetCrescentOfsY ( const AValue : Single ) ;
- protected procedure SetDepolarizationFactor ( const AValue : Single ) ;
- protected procedure SetDiffuse ( const AValue : TAlphaColor ) ;
- protected procedure SetEmissive ( const AValue : TAlphaColor ) ;
- protected procedure SetInclination ( const AValue : Single ) ;
- protected procedure SetLuminance ( const AValue : Single ) ;
- protected procedure SetMieCoefficient ( const AValue : Single ) ;
- protected procedure SetMieDirectionalG ( const AValue : Single ) ;
- protected procedure SetMieKCoefficient ( const AValue : TVector3D ) ;
- protected procedure SetMieKCoefficientByIdx ( AIndex : Integer; const AValue : Single ) ;
- protected procedure SetMieV ( const AValue : Single ) ;
- protected procedure SetMieZenithLength ( const AValue : Single ) ;
- protected procedure SetMoonSurface ( const AValue : Single ) ;
- protected procedure SetNumMolecules ( const AValue : Single ) ;
- protected procedure SetPrimaries ( const AValue : TPoint3D ) ;
- protected procedure SetPrimariesByIdx ( AIndex : Integer; const AValue : Single ) ;
- protected procedure SetRayleigh ( const AValue : Single ) ;
- protected procedure SetRayleighZenithLength ( const AValue : Single ) ;
- protected procedure SetRefractiveIndex ( const AValue : Single ) ;
- protected procedure SetStarBrightness ( const AValue : Single ) ;
- protected procedure SetStarColor ( const AValue : TAlphaColor ) ;
- protected procedure SetStarDensity ( const AValue : Single ) ;
- protected procedure SetStarProbe ( const AValue : Single ) ;
- protected procedure SetStarSize ( const AValue : Single ) ;
- protected procedure SetStarSpark ( const AValue : Single ) ;
- protected procedure SetSunAngularDiameterDegrees ( const AValue : Single ) ;
- protected procedure SetSunIntensityFactor ( const AValue : Single ) ;
- protected procedure SetSunIntensityFalloffSteepness ( const AValue : Single ) ;
- protected procedure SetTonemapWeighting ( const AValue : Single ) ;
- protected procedure SetTurbidity ( const AValue : Single ) ;
- public procedure LoadCubeMapFacesFromPath
(
APath :
string; AFileExt :
string
)
;
Automatically load a cubemap defined by its path to the texture sides of the skybox.
- public procedure RebuildMesh ( AIsStatic : Boolean = True ) ; override;
- public function GetConfiguration
(
)
: TSkyBoxShaderData
;
Get all skybox settings (except textures) at once.
- public procedure SetConfiguration
(
const
AProps :
TSkyBoxShaderData
)
;
To set all configuration properties at once.
- public function ToJSON
(
)
: TJSONObject
;
To save skybox settings into a json format. Except textures all properties will be stored.
- public procedure FromJSON
(
AJSON :
TJSONObject
)
;
To load skybox settings from a json object. Except textures all properties are loaded.
- public procedure LoadFromStream
(
AStream :
TStream
)
;
Load skybox configuration (without textures) from stream in JSON format.
- public procedure LoadFromFile
(
AFileName :
string
)
;
Load skybox configuration (without textures) from file in JSON format.
- public procedure SaveToStream
(
AStream :
TStream
)
;
Save skybox configuration (without textures) to stream in JSON format.
- public procedure SaveToFile
(
AFileName :
string
)
;
Save skybox configuration (without textures) to file in JSON format.
Properties
- public Size : TPoint3D
- public Textures[Index] : TBitmap
Indiced texture array property for applying a texture to a single side of the skybox.
read GetTexture
write SetTexture - public CrescentOfs : TPointF
Get or set the X and Y offset of the shadow of a crescendent sundisk/moon.
read GetCrescentOfs
write SetCrescentOfs - public MieKCoefficient : TVector3D
- public Primaries : TPoint3D
Primaries control the basis coloring of sun gradient computation. It's recommended to use very low values < 0e-6.
read GetPrimaries
write SetPrimaries - published Mode : TGorillaSkyBoxMode
- published AllowFog : Boolean
- published FrontSide : TBitmap
Get or set the front side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.NegativeZ].
read GetTexture
write SetTexture - published BackSide : TBitmap
Get or set the back side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.PositiveZ].
read GetTexture
write SetTexture - published TopSide : TBitmap
Get or set the top side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.PositiveY].
read GetTexture
write SetTexture - published BottomSide : TBitmap
Get or set the bottom side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.NegativeY].
read GetTexture
write SetTexture - published LeftSide : TBitmap
Get or set the left side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.NegativeX].
read GetTexture
write SetTexture - published RightSide : TBitmap
Get or set the right side image of the skybox. Alternatively set bitmap by Textures[TGorillaCubeMapFace.PositiveX].
read GetTexture
write SetTexture - published CrescentMoon : Single
Get or set the brightness of a sundisk/moon shadow. If the value is zero no shadow will be rendered.
read GetCrescentMoon
write SetCrescentMoon - published Crescent : Boolean
- published CrescentOfsX : Single
Get or set the X offset of the shadow of a crescendent sundisk/moon.
read GetCrescentOfsX
write SetCrescentOfsX - published CrescentOfsY : Single
Get or set the Y offset of the shadow of a crescendent sundisk/moon.
read GetCrescentOfsY
write SetCrescentOfsY - published MoonSurface : Single
Get or set intensity of a rendered moon surface. If the value is zero, no surface will be rendered.
read GetMoonSurface
write SetMoonSurface - published DepolarizationFactor : Single
- published Diffuse : TAlphaColor
Get or set diffuse color. On blank rendering this represents the blank color, while other modes will be colorized.
read GetDiffuse
write SetDiffuse - published Emissive : TAlphaColor
Get or set emissive color. On blank rendering emissive color is ignored.
read GetEmissive
write SetEmissive - published Luminance : Single
- published MieCoefficient : Single
- published MieDirectionalG : Single
- published MieV : Single
- published MieZenithLength : Single
- published MieKCoefficientX : Single
- published MieKCoefficientY : Single
- published MieKCoefficientZ : Single
- published MieKCoefficientW : Single
- published PrimariesA : Single
Primaries control the basis coloring of sun gradient computation. It's recommended to use very low values < 0e-6.
read GetPrimariesByIdx
write SetPrimariesByIdx - published PrimariesB : Single
Primaries control the basis coloring of sun gradient computation. It's recommended to use very low values < 0e-6.
read GetPrimariesByIdx
write SetPrimariesByIdx - published PrimariesC : Single
Primaries control the basis coloring of sun gradient computation. It's recommended to use very low values < 0e-6.
read GetPrimariesByIdx
write SetPrimariesByIdx - published NumMolecules : Single
Get or set the number of molecules. This is a very large number, f.e. 4e25. The larger the number is, the more noisy the result will become.
read GetNumMolecules
write SetNumMolecules - published Rayleigh : Single
- published RayleighZenithLength : Single
- published RefractiveIndex : Single
- published SunAngularDiameterDegrees : Single
Get or set the diameter of sundisk/moon. In fact this controls the size of your rendered sun/moon.
read GetSunAngularDiameterDegrees
write SetSunAngularDiameterDegrees - published SunIntensityFactor : Single
- published SunIntensityFalloffSteepness : Single
- published TonemapWeighting : Single
- published Turbidity : Single
- published Inclination : Single
Get or set inclination of the sundisk/moon. In combination with the Azimuth property this will control the position of the sundisk/moon on the skybox.
read GetInclination
write SetInclination - published Azimuth : Single
Get or set the azimuth of the sundisk/moon. In combination with the Inclination property this will control the position of the sundisk/moon on the skybox.
read GetAzimuth
write SetAzimuth - published StarDensity : Single
Get or set the density of stars rendered. If the value is zero, no stars will be rendered.
read GetStarDensity
write SetStarDensity - published StarProbe : Single
Get or set the randomness limit value of rendered stars. This value influences the number of and distribution of stars.
read GetStarProbe
write SetStarProbe - published StarSize : Single
- published StarSpark : Single
- published StarBrightness : Single
- published StarColor : TAlphaColor
- published CloudColor : TAlphaColor
- published CloudIterations : Integer
Get or set the number of iterations performed to produce clouds in the shader. The more iterations, the more noise will be rendered.
read GetCloudIterations
write SetCloudIterations - published CloudFrequency : Single
Get or set the frequency used to render clouds. The frequency controls also the size of clouds. The lower the value is, the larger the clouds. Combine this property with CloudIterations to produce a good result.
read GetCloudFrequency
write SetCloudFrequency - published CloudAmplitude : Single
Get or set the amplitude of rendered clouds. The amplitude controls the mixture of bright and dark parts of a cloud. The larger the value is, the more extreme the change between bright and dark will become.
read GetCloudAmplitude
write SetCloudAmplitude