Gorilla.Material.SplatMap
Unit Gorilla.Material.SplatMap.pasClasses
- TGorillaSplatMapMaterial = class ( TGorillaDefaultMaterial )
- TGorillaSplatMapMaterialSource = class ( TGorillaDefaultMaterialSource )
Constants
- const GORILLA_SPLATMAP_TEXTURES : Integer = $4;
- const GORILLA_GLSL_DEFINE_SPLATMAP : string = "SPLATMAP";
- const GORILLA_MATERIAL_TEXTURE : string = "SplatTexture%%d";
TGorillaSplatMapMaterial
A SplatMap material renders maximum 4 textures overlayed depending on the supplied splatmap texture which is used as control element.
Remarks
To use more than 4 overlayed textures, please apply mulitple TGorillaSplatMapMaterialSource instances to a TGorillaLayeredMaterialSource.
Of course the each splatmap should have the valid transparency settings, otherwise layered material shader would overwrite pixels.
Ancestors
Members
Fields
Methods
- public constructor Create ( const ASource : TGorillaDefaultMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoCreateVertexShader ( ) ; override;
- protected procedure DoCreateFragmentShader ( ) ; override;
- protected procedure DoSetupFragmentShader ( ) ; override;
Properties
- public UseBlackAsTransparent : Boolean
Enable black color as transparent areas. This is useful for multiple splatmaps in a layered materials.
read FUseBlackAsTransparent
write FUseBlackAsTransparent
TGorillaSplatMapMaterialSource
A SplatMap material renders maximum 4 textures overlayed depending on the supplied splatmap texture which is used as control element.
Remarks
To use more than 4 overlayed textures, please apply mulitple TGorillaSplatMapMaterialSource instances to a TGorillaLayeredMaterialSource.
Of course the each splatmap should have the valid transparency settings, otherwise layered material shader would overwrite pixels.
Ancestors
Members
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetSplatTexture ( AIndex : Integer ) : TBitmap ; virtual;
- protected procedure SetSplatTexture ( AIndex : Integer; const AValue : TBitmap ) ; virtual;
- protected function GetSplatTextureTiling ( AIndex : Byte ) : TPointF ; virtual;
- protected procedure SetSplatTextureTiling ( AIndex : Byte; const AValue : TPointF ) ; virtual;
- protected function GetUseBlackAsTransparent ( ) : Boolean ; virtual;
- protected procedure SetUseBlackAsTransparent ( const AValue : Boolean ) ; virtual;
- protected function CreateMaterial ( ) : TMaterial ; override;
Properties
- public SplatTexture[Index] : TBitmap
Indices property for splat textures. Each index from 0..3 represents a texture to rendered with in splatmap shader.
read GetSplatTexture
write SetSplatTexture - public SplatTextureTiling[Index] : TPointF
Get or set texture tiling for each splat map texture.
read GetSplatTextureTiling
write SetSplatTextureTiling - published SplatTexture0 : TBitmap
First texture used by the r channel of the splatmap texture.
read GetSplatTexture
write SetSplatTexture - published SplatTexture1 : TBitmap
Second texture used by the g channel of the splatmap texture.
read GetSplatTexture
write SetSplatTexture - published SplatTexture2 : TBitmap
Third texture used by the b channel of the splatmap texture.
read GetSplatTexture
write SetSplatTexture - published SplatTexture3 : TBitmap
Fourth texture used by the a channel of the splatmap texture.
read GetSplatTexture
write SetSplatTexture - published UseBlackAsTransparent : Boolean
Enable black color as transparent areas. This is useful for multiple splatmaps in a layered materials.
read GetUseBlackAsTransparent
write SetUseBlackAsTransparent