Gorilla.Controller.Passes.Environment
Unit Gorilla.Controller.Passes.Environment.pasClasses
- TGorillaRenderPassEnvironment = class ( TGorillaRenderPassController )
TGorillaRenderPassEnvironment
The environment render pass component is capable of rendering a scene from a specific point in scene into a cubemap. Use the resulting texture for applying to materials as environment map. You can choose between a static and a dynamic mode. While the static mode only renders once, the dynamic mode will render the scene every cycle.
Ancestors
Members
Fields
- protected FCamera :
TGorillaCamera
- protected FMapSize :
Integer
- protected FCubeMap :
TGorillaCubeMapTextureBitmap
- protected FIsDynamic :
Boolean
Methods
- public constructor Create ( AOwner : TComponent; const AId : string = Environment ) ;
- public destructor Destroy ( ) ;
- protected function CreateMaterialSource ( ) : TGorillaRenderPassMaterialSource ; override;
- protected function GetCamera ( ) : TCamera ;
- protected function GetCubeMap ( ) : TTextureBitmap ;
- protected function GetPosition ( ) : TPoint3D ;
- protected procedure SetPosition ( const AValue : TPoint3D ) ;
- protected function GetIsDynamic ( ) : Boolean ;
- protected procedure SetIsDynamic ( const AValue : Boolean ) ;
- protected function GetMapSize ( ) : Integer ;
- protected procedure SetMapSize ( const AValue : Integer ) ;
- protected procedure DoCreateRenderer ( ) ; override;
- protected procedure DoOnCreateCompositeTexture ( ASender : TObject; const ASize : TPoint; const AScale : Single; out ATexture : TGorillaTextureBitmap ) ; override;
- protected procedure DoOnBeginRenderPassSetup ( const ACount : Integer; const APass : TRenderPass ) ; override;
- protected procedure DoOnEndRenderPassSetup ( const ACount : Integer; const APass : TRenderPass ) ; override;
- protected procedure DoSetupTexturesByViewport ( const AContext : TContext3D; const AWidth : Integer; const AHeight : Integer ) ; override;
- protected function GetInternalOutputTexture ( ) : TTexture ;
- protected procedure DefineProperties ( Filer : TFiler ) ; override;
- protected procedure ReadPosition ( Reader : TReader ) ;
- protected procedure WritePosition ( Writer : TWriter ) ;
- public procedure AfterConstruction ( ) ; override;
- public function GetViewMatrix ( const AContext : TContext3D ) : TMatrix3D ; overload override;
- public function GetProjectionMatrix ( const AContext : TContext3D ) : TMatrix3D ; overload override;
- public procedure SetupMatrices ( const AContext : TContext3D ) ; virtual;
- public function GetOutputTexture ( ) : TTexture ; override;
- public function GetTextureMatrix ( AContext : TContext3D; const AUseBias : Boolean = True ) : TMatrix3D ; override;
- public procedure InvalidateEnvironment
(
)
;
In case you have set "IsDynamic" to FALSE, static rendering is activated. Call this method to refresh rendering. It will automatically be called if camera position was modified.
Properties
- public Camera : TCamera
Returns internal camera used for cubemap rendering. Some properties may be overwritten by renderpass, f.e. RotationAngle or FieldOfView.
read GetCamera - public MapSize : Integer
Get or set the quadratic cubemap size used for rendering. Recommended values are multiples of 2: 16, 32, 64, 128, 256, 512, 1024, ... The size of cubemap matters. The larger it is, the slower rendering will become.
read GetMapSize
write SetMapSize - public BiasMatrix : TMatrix3D
- public CubeMap : TTextureBitmap
Returns the internally declared TGorillaCubeMapTextureBitmap instance. Do not use it as TTextureBitmap, because important information will get lost!
read GetCubeMap - published Position : TPoint3D
Get or set camera position directly. In static rendering mode, the rendering will automatically be refreshed. This value is stored as "PositionPoint" in DFM file.
read GetPosition
write SetPosition - published IsDynamic : Boolean
Set IsDynamic to TRUE if you want to render environment on each render-cycle. By default this value is set to FALSE (static mode). Rendering on each render-cycle is not recommended.
read GetIsDynamic
write SetIsDynamic