Gorilla.Material.Water
Unit Gorilla.Material.Water.pasClasses
- TGorillaWaterMaterial = class ( TGorillaDefaultMaterial )
- TGorillaWaterMaterialSource = class ( TGorillaDefaultMaterialSource )
Records
- record TWaterParams
Enumerations
- enum TWaterOutputLayer = ( wolAll, wolDUDV, wolNormal, wolSpecular, wolFoam, wolDepth, wolRefraction, wolReflection, wolReflPlusRefr, wolTexCoords ) ;
Constants
- const WATER_TEX_DUDV : Integer = $0;
- const WATER_TEX_FOAM : Integer = $1;
- const WATER_TEX_SPEC : Integer = $2;
- const WATER_TEX_NRML : Integer = $3;
- const WATER_TEX_DSPL : Integer = $4;
- const WATER_TEX_DPTH : Integer = $5;
- const WATER_TEX_REFR : Integer = $6;
- const WATER_TEX_REFL : Integer = $7;
- const WATER_TEX_ENVM : Integer = $5;
- const MAX_RIPPLES : Integer = $20;
Mics. types
- type PWaterParams = pointer to TWaterParams;
TWaterParams
Fields
- public Time :
Single
- public WaveSize :
Single
- public WaveSpeed :
Single
- public DiffusePower :
Single
- public ReflCorrection :
TVector3D
- public RefrCorrection :
TVector3D
- public FoamDirection :
TPointF
- public FoamIntensity :
Single
- public OutputLayer :
Single
- public RippleCount :
Single
- public RippleAmplification :
Single
- public RippleProximity :
Single
- public RippleDecay :
Single
- public Ripples :
TGorillaWaterMaterial
Default water material that creates a moving water effect by using different textures. It also needs applied reflection-, refraction- and depth-pass render passes.
Remarks
The shader needs a normal, dudv and specular texture for rendering. Also it needs applied reflection and refraction render passes. The refraction render pass automatically produces a depth map which the water shader needs.Ancestors
Members
Fields
- protected FMoveFactor :
Single
- protected FRipplesActive :
Boolean
- protected FWaterParams :
TWaterParams
- protected FRippleList :
TList<System.Math.Vectors.TVector3D>
- protected FRipplesChanged :
Boolean
- protected FDUDVTexture :
TTexture
- protected FFoamTexture :
TTexture
- protected FDesignTimer :
TTimer
Methods
- public constructor Create ( const ASource : TGorillaDefaultMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected function GetWaveSpeed ( ) : Single ;
- protected procedure SetWaveSpeed ( const AValue : Single ) ;
- protected function GetWaveSize ( ) : Single ;
- protected procedure SetWaveSize ( const AValue : Single ) ;
- protected function GetDiffusePower ( ) : Single ;
- protected procedure SetDiffusePower ( const AValue : Single ) ;
- protected function GetFoamDirection ( ) : TPointF ;
- protected procedure SetFoamDirection ( const AValue : TPointF ) ;
- protected function GetFoamIntensity ( ) : Single ;
- protected procedure SetFoamIntensity ( const AValue : Single ) ;
- protected function GetOutputLayer ( ) : TWaterOutputLayer ;
- protected procedure SetOutputLayer ( const AValue : TWaterOutputLayer ) ;
- protected function GetReflCorrection ( ) : TVector3D ;
- protected procedure SetReflCorrection ( const AValue : TVector3D ) ;
- protected function GetRefrCorrection ( ) : TVector3D ;
- protected procedure SetRefrCorrection ( const AValue : TVector3D ) ;
- protected function GetDUDVTexture ( ) : TTexture ;
- protected procedure SetDUDVTexture ( const Value : TTexture ) ;
- protected function GetFoamTexture ( ) : TTexture ;
- protected procedure SetFoamTexture ( const Value : TTexture ) ;
- protected function GetRipplesActive ( ) : Boolean ;
- protected procedure SetRipplesActive ( const AValue : Boolean ) ;
- protected function GetRippleAmplification ( ) : Single ;
- protected procedure SetRippleAmplification ( const AValue : Single ) ;
- protected function GetRippleProximity ( ) : Single ;
- protected procedure SetRippleProximity ( const AValue : Single ) ;
- protected function GetRippleDecay ( ) : Single ;
- protected procedure SetRippleDecay ( const AValue : Single ) ;
- protected procedure DoRegisterShaderConstants ( AShader : TGorillaGLSLNodeBuilder ) ;
- protected procedure DoCreateTexturePool ( ) ; override;
- protected procedure DoCreateVertexShader ( ) ; override;
- protected procedure DoSetupVertexShader ( ) ; override;
- protected procedure DoCreateFragmentShader ( ) ; override;
- protected procedure DoSetupFragmentShader ( ) ; override;
- protected procedure DoUpdateShaderUniformBuffers ( const Context : TContext3D; AProgram : TShaderProgram ) ; override;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoOnDesignTimeRefresh ( ASender : TObject ) ;
- protected procedure DoRipplesApply ( ) ;
- public procedure AddRipple
(
APos :
TVector3D
)
;
overload;
Adds a new ripple point to the internal list. If the list size exceeds, the eldest point will be removed.
- public procedure AddRipple
(
APos :
TPoint3D
)
;
overload;
Adds a new ripple point to the internal list. If the list size exceeds, the eldest point will be removed.
- public procedure AddRipples
(
const
AArr :
TArray<System.Math.Vectors.TVector3D>
)
;
Adds an array of ripple points to the internal list. If the list size exceeds, the eldest points will be removed.
- public procedure SetRipples
(
const
AArr :
TArray<System.Math.Vectors.TVector3D>
)
;
Clears the current ripple points and adds all given points.
- public procedure ClearRipples
(
)
;
Clears all currently available ripples.
Properties
- public WaveSpeed : Single
- public WaveSize : Single
- public DiffusePower : Single
Defines the mixture value between diffuse color and refraction channel.
read GetDiffusePower
write SetDiffusePower - public FoamDirection : TPointF
Get or set the direction of which the foam texture is floating to.
read GetFoamDirection
write SetFoamDirection - public FoamIntensity : Single
Defines the mixture value between foam color and diffuse color.
read GetFoamIntensity
write SetFoamIntensity - public OutputLayer : TWaterOutputLayer
Get or set the layer output for the water shader. This allows to output only specific layers of the water shader.
read GetOutputLayer
write SetOutputLayer - public ReflCorrection : TVector3D
The reflection correction value allowes to influence reflective color on water surface.
read GetReflCorrection
write SetReflCorrection - public RefrCorrection : TVector3D
The refraction correction value allowes to influence refractive color on water surface.
read GetRefrCorrection
write SetRefrCorrection - public DUDVTexture : TTexture
- public FoamTexture : TTexture
- public RipplesActive : Boolean
- public RippleAmplification : Single
Get or set amplification value for ripples. Simply said: Amplification describes the height of the ripple.
read GetRippleAmplification
write SetRippleAmplification - public RippleProximity : Single
Get or set proximity value for ripples. Simply said: Proximity is the basis value for the width of a ripple.
read GetRippleProximity
write SetRippleProximity - public RippleDecay : Single
Get or set decay value for ripples. Simply said: It defines how fast a ripple will end.
read GetRippleDecay
write SetRippleDecay
TGorillaWaterMaterialSource
Basic water material source.
Remarks
Shader was built on basis of a GLSL conversion of Michael Horsch water demo http://www.bonzaisoftware.com/wfs.html Converted by Mars_999 8/20/2005 http://forum.bonzaisoftware.com/viewthread.php?tid=10Ancestors
Members
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetWaveSpeed ( ) : Single ;
- protected procedure SetWaveSpeed ( AValue : Single ) ;
- protected function GetWaveSize ( ) : Single ;
- protected procedure SetWaveSize ( AValue : Single ) ;
- protected function GetDiffusePower ( ) : Single ;
- protected procedure SetDiffusePower ( AValue : Single ) ;
- protected function GetFoamDirection ( ) : TPointF ;
- protected procedure SetFoamDirection ( const AValue : TPointF ) ;
- protected function GetFoamIntensity ( ) : Single ;
- protected procedure SetFoamIntensity ( const AValue : Single ) ;
- protected function GetOutputLayer ( ) : TWaterOutputLayer ;
- protected procedure SetOutputLayer ( const AValue : TWaterOutputLayer ) ;
- protected function GetReflCorrection ( ) : TVector3D ;
- protected procedure SetReflCorrection ( AValue : TVector3D ) ;
- protected function GetRefrCorrection ( ) : TVector3D ;
- protected procedure SetRefrCorrection ( AValue : TVector3D ) ;
- protected function GetDUDVTexture ( ) : TBitmap ;
- protected procedure SetDUDVTexture ( const AValue : TBitmap ) ;
- protected function GetFoamTexture ( ) : TBitmap ;
- protected procedure SetFoamTexture ( const AValue : TBitmap ) ;
- protected function GetSpecularMap ( ) : TBitmap ;
- protected procedure SetSpecularMap ( const AValue : TBitmap ) ;
- protected function GetRipplesActive ( ) : Boolean ;
- protected procedure SetRipplesActive ( const AValue : Boolean ) ;
- protected function GetRippleAmplification ( ) : Single ;
- protected procedure SetRippleAmplification ( const AValue : Single ) ;
- protected function GetRippleProximity ( ) : Single ;
- protected procedure SetRippleProximity ( const AValue : Single ) ;
- protected function GetRippleDecay ( ) : Single ;
- protected procedure SetRippleDecay ( const AValue : Single ) ;
- protected function CreateMaterial ( ) : TMaterial ; override;
- protected procedure DoCreateDefaultBitmaps ( ) ; override;
- protected procedure DefineProperties ( Filer : TFiler ) ; override;
- protected procedure ReadFoamDirection ( Reader : TReader ) ;
- protected procedure WriteFoamDirection ( Writer : TWriter ) ;
- protected procedure ReadReflCorrection ( Reader : TReader ) ;
- protected procedure WriteReflCorrection ( Writer : TWriter ) ;
- protected procedure ReadRefrCorrection ( Reader : TReader ) ;
- protected procedure WriteRefrCorrection ( Writer : TWriter ) ;
- protected procedure ReadDisplacement ( Reader : TReader ) ;
- protected procedure WriteDisplacement ( Writer : TWriter ) ;
- public procedure AddRipple
(
APos :
TVector3D
)
;
overload;
Adds a new ripple point to the internal list. If the list size exceeds, the eldest point will be removed.
- public procedure AddRipple
(
APos :
TPoint3D
)
;
overload;
Adds a new ripple point to the internal list. If the list size exceeds, the eldest point will be removed.
- public procedure AddRipples
(
const
AArr :
TArray<System.Math.Vectors.TVector3D>
)
;
Adds an array of ripple points to the internal list. If the list size exceeds, the eldest points will be removed.
- public procedure SetRipples
(
const
AArr :
TArray<System.Math.Vectors.TVector3D>
)
;
Clears the current ripple points and adds all given points.
- public procedure ClearRipples
(
)
;
Clears all currently available ripples.
Properties
- published UseLighting : Boolean
- published UseSpecular : Boolean
- published UseTexturing : Boolean
- published UseVertexColor : Boolean
- published UseColorClipping : Boolean
- published Diffuse : TAlphaColor
- published Emissive : TAlphaColor
- published Ambient : TAlphaColor
- published Specular : TAlphaColor
- published Shininess : Single
- published ClippingColor : TAlphaColor
- published NearLimit : Single
- published FarLimit : Single
- published Shadows : Boolean
- published ShadowMethod : TGorillaShadowMethod
- published DepthPass : TGorillaRenderPassController
- published Reflections : Boolean
- published ReflectionPass : TGorillaRenderPassController
- published ReflectionPower : Single
- published Refractions : Boolean
- published RefractionPass : TGorillaRenderPassController
- published RefractionPower : Single
- published WaveSpeed : Single
- published WaveSize : Single
- published DiffusePower : Single
Defines the mixture value between diffuse color and refraction channel.
read GetDiffusePower
write SetDiffusePower - published FoamDirection : TPointF
Get or set the direction of which the foam texture is floating to.
read GetFoamDirection
write SetFoamDirection - published FoamIntensity : Single
Defines the mixture value between foam color and diffuse channel.
read GetFoamIntensity
write SetFoamIntensity - published OutputLayer : TWaterOutputLayer
Get or set the layer output for the water shader. This allows to output only specific layers of the water shader.
read GetOutputLayer
write SetOutputLayer - published ReflCorrection : TVector3D
The reflection correction value allowes to influence reflective color on water surface. This value is stored as "ReflCorrectionVector" in DFM!
read GetReflCorrection
write SetReflCorrection - published RefrCorrection : TVector3D
The refraction correction value allowes to influence refractive color on water surface. This value is stored as "RefrCorrectionVector" in DFM!
read GetRefrCorrection
write SetRefrCorrection - published FoamTexture : TBitmap
- published DUDVTexture : TBitmap
- published NormalMap : TBitmap
Get or set normal map texture for wave computation.
- published SpecularMap : TBitmap
Get or set the specular map texture to manage specular color.
read GetSpecularMap
write SetSpecularMap - published Displacement : TVector3D
Get or set displacement direction vector. This value is stored as "DisplacementVector" in DFM!
- published DisplacementMap : TBitmap
Get or set displacement map texture.
- published RipplesActive : Boolean
- published RippleAmplification : Single
Get or set amplification value for ripples. Simply said: Amplification describes the height of the ripple.
read GetRippleAmplification
write SetRippleAmplification - published RippleProximity : Single
Get or set proximity value for ripples. Simply said: Proximity is the basis value for the width of a ripple.
read GetRippleProximity
write SetRippleProximity - published RippleDecay : Single
Get or set decay value for ripples. Simply said: It defines how fast a ripple will end.
read GetRippleDecay
write SetRippleDecay - published Bitmaps : TGorillaBitmapPool