Gorilla.Material.Particle
Unit Gorilla.Material.Particle.pasClasses
- TGorillaParticleMaterial = class ( TGorillaDefaultMaterial )
- TGorillaParticleMaterialSource = class ( TGorillaDefaultMaterialSource )
TGorillaParticleMaterial
Default particle material for rendering particles. The shader allows to use particles with or without texture.
Remarks
The most common usage is to render with texture atlas for realistic animated particle effects.Ancestors
Members
Fields
- private FUseTexture :
Boolean
- private FIsTextureAtlas :
Boolean
- private FAtlasRowCount :
Word
- private FAtlasColCount :
Word
- private FFrameWidth :
Word
- private FFrameHeight :
Word
- protected FEmitter :
TComponent
Methods
- public constructor Create ( const ASource : TGorillaDefaultMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected function GetUseTexture ( ) : Boolean ;
- protected procedure SetUseTexture ( const AValue : Boolean ) ;
- protected function GetIsTextureAtlas ( ) : Boolean ;
- protected procedure SetIsTextureAtlas ( const AValue : Boolean ) ;
- protected function GetAtlasColCount ( ) : Word ;
- protected procedure SetAtlasColCount ( const AValue : Word ) ;
- protected function GetAtlasRowCount ( ) : Word ;
- protected procedure SetAtlasRowCount ( const AValue : Word ) ;
- protected function GetFrameHeight ( ) : Word ;
- protected procedure SetFrameHeight ( const AValue : Word ) ;
- protected function GetFrameWidth ( ) : Word ;
- protected procedure SetFrameWidth ( const AValue : Word ) ;
- protected procedure UpdateShaderDefines
(
)
;
Update vertex and fragment shader defines, depending on the FUseTexture and FIsTextureAtlas.
- protected procedure DoCreateVertexShader ( ) ; override;
- protected procedure DoCreateFragmentShader ( ) ; override;
- protected procedure DoSetupFragmentShader ( ) ; override;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
Properties
- public Emitter : TComponent
- public UseTexture : Boolean
Defines if a texture is used by shader for rendering particles.
read GetUseTexture
write SetUseTexture - public IsTextureAtlas : Boolean
- public AtlasRowCount : Word
- public AtlasColCount : Word
- public FrameWidth : Word
Defines the width of each frame in pixels. The width has to be a potency of 2. For example: 16, 32, 64, 128, ...
read GetFrameWidth
write SetFrameWidth - public FrameHeight : Word
Defines the height of each frame in pixels. The height has to be a potency of 2. For example: 16, 32, 64, 128, ...
read GetFrameHeight
write SetFrameHeight
TGorillaParticleMaterialSource
Default particle material source for rendering particles with or without a texture.
Remarks
The most common usage is to render with texture atlas for realistic animated particle effects.Ancestors
Members
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function CreateMaterial ( ) : TMaterial ; override;
- protected function GetEmitter ( ) : TComponent ;
- protected procedure SetEmitter ( const AValue : TComponent ) ;
- protected function GetUseTexture ( ) : Boolean ;
- protected procedure SetUseTexture ( const AValue : Boolean ) ;
- protected function GetIsTextureAtlas ( ) : Boolean ;
- protected procedure SetIsTextureAtlas ( const AValue : Boolean ) ;
- protected function GetAtlasColCount ( ) : Word ;
- protected procedure SetAtlasColCount ( const AValue : Word ) ;
- protected function GetAtlasRowCount ( ) : Word ;
- protected procedure SetAtlasRowCount ( const AValue : Word ) ;
- protected function GetFrameHeight ( ) : Word ;
- protected procedure SetFrameHeight ( const AValue : Word ) ;
- protected function GetFrameWidth ( ) : Word ;
- protected procedure SetFrameWidth ( const AValue : Word ) ;
- public function GetTextureAtlasFrameSize ( ) : TPointF ;
- public function GetTextureAtlasOffset ( const ADeltaTime : Single ) : TPointF ;
Properties
- published Emitter : TComponent
Reference to parent particle emitter component. The parent emitter is need to determine particle size and further information.
read GetEmitter
write SetEmitter - published UseTexture : Boolean
Defines if a texture is used by shader for rendering particles.
read GetUseTexture
write SetUseTexture - published IsTextureAtlas : Boolean
- published AtlasRowCount : Word
- published AtlasColCount : Word
- published FrameWidth : Word
Defines the width of each frame in pixels. The width has to be a potency of 2. For example: 16, 32, 64, 128, ...
read GetFrameWidth
write SetFrameWidth - published FrameHeight : Word
Defines the height of each frame in pixels. The height has to be a potency of 2. For example: 16, 32, 64, 128, ...
read GetFrameHeight
write SetFrameHeight - published Texture : TBitmap