Gorilla.Material.Grass
Unit Gorilla.Material.Grass.pasClasses
- TGorillaGrassMaterial = class ( TGorillaDefaultMaterial )
- TGorillaGrassMaterialSource = class ( TGorillaDefaultMaterialSource )
Constants
- const GORILLA_GLSL_DEFINE_GRASS : string = "GRASS";
TGorillaGrassMaterial
The grass material implements a shader which applies a texture to billboard elements built with TGorillaBillboard component. The shader also moves vertices less than 0.0 on x and z axis by sin and cos functions to simulate some kind of waving grass. Those waving mechanism can be manipulated by the Speed and Amplitude value.
Ancestors
Members
Fields
- protected FSpeed :
Single
- protected FAmplitude :
Single
- protected FSpot :
TPoint3D
- protected FSpotRadius :
Single
- protected FSpotEnabled :
Boolean
- protected FCutoutLevel :
Single
Methods
- public constructor Create ( const ASource : TGorillaDefaultMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoCreateTexturePool ( ) ; override;
- protected procedure DoCreateVertexShader ( ) ; override;
- protected procedure DoSetupVertexShader ( ) ; override;
- protected procedure DoCreateFragmentShader ( ) ; override;
- protected procedure DoSetupFragmentShader ( ) ; override;
Properties
- public Speed : Single
- public Amplitude : Single
Get or set the maximum amplitude of waving grass. The larger this value, the more waving the grass is.
read FAmplitude
write FAmplitude - public Spot : TPoint3D
- public SpotRadius : Single
Get or set radius of obstacle which is used to simulate bending of grass.
read FSpotRadius
write FSpotRadius - public SpotEnabled : Boolean
- public CutoutLevel : Single
TGorillaGrassMaterialSource
The grass material source implements a shader which applies a texture to billboard elements built with TGorillaBillboard component. The shader also moves vertices less than 0.0 on x and z axis by sin and cos functions to simulate some kind of waving grass. Those waving mechanism can be manipulated by the Speed and Amplitude value.
Remarks
By the bitmap-pool it is possible to declare multiple textures for more variety in billboard element display. In most cases grass with a single texture do not look very realistic.Ancestors
Members
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetSpeed ( ) : Single ;
- protected procedure SetSpeed ( const AValue : Single ) ;
- protected function GetAmplitude ( ) : Single ;
- protected procedure SetAmplitude ( const AValue : Single ) ;
- protected function GetSpot ( ) : TPoint3D ;
- protected procedure SetSpot ( const AValue : TPoint3D ) ;
- protected function GetSpotRadius ( ) : Single ;
- protected procedure SetSpotRadius ( const AValue : Single ) ;
- protected function GetSpotEnabled ( ) : Boolean ;
- protected procedure SetSpotEnabled ( const AValue : Boolean ) ;
- protected function GetCutoutLevel ( ) : Single ;
- protected procedure SetCutoutLevel ( const AValue : Single ) ;
- protected procedure DoCreateBitmapPool ( ) ; override;
- protected function CreateMaterial ( ) : TMaterial ; override;
Properties
- published Speed : Single
- published Amplitude : Single
Get or set the maximum amplitude of waving grass. The larger this value, the more waving the grass is.
read GetAmplitude
write SetAmplitude - published Spot : TPoint3D
- published SpotRadius : Single
Get or set radius of obstacle which is used to simulate bending of grass.
read GetSpotRadius
write SetSpotRadius - published SpotEnabled : Boolean
- published CutoutLevel : Single
Get or set the cutout alpha level where fragments are discarded by shader to produce better transparency effects.
read GetCutoutLevel
write SetCutoutLevel