Gorilla.Controller.Passes.Environment
Unit Gorilla.Controller.Passes.Environment.pasClasses
- TGorillaRenderPassEnvironment = class ( TGorillaRenderPassController )
Constants
- const DEFAULT_ANGLEOFVIEW : Integer = $5A;
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 FLight :
TGorillaLight
- protected FLightIndex :
Integer
- protected FUseEmbeddedLight :
Boolean
- protected FMapSize :
Integer
- protected FCubeMap :
TGorillaTextureBitmap
- protected FIsDynamic :
Boolean
- protected FStoredCameraPos :
TPoint3D
- protected FStoredTargetPos :
TPoint3D
- protected FCenterOffset :
- protected FTarget :
TControl3D
- private FBiasMatrix :
TMatrix3D
Methods
- public constructor Create ( AOwner : TComponent; const AId : string = Environment ) ;
- public destructor Destroy ( ) ;
- protected function CreateMaterialSource ( ) : TGorillaRenderPassMaterialSource ; override;
- protected function GetCamera ( ) : TCamera ;
- protected function GetEmbeddedLight ( ) : TLight ;
- 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 function GetCenterOffset ( AIndex : Integer ) : Single ;
- protected procedure SetCenterOffset ( AIndex : Integer; const AValue : Single ) ;
- protected function GetCenterOffsetDir ( AIndex : Integer ) : TPoint3D ;
- protected function GetUseEmbeddedLight ( ) : Boolean ;
- protected procedure SetUseEmbeddedLight ( const AValue : Boolean ) ;
- protected function GetTarget ( ) : TControl3D ;
- protected procedure SetTarget ( const AValue : TControl3D ) ;
- protected procedure SetViewportSize ( AValue : TPoint ) ; override;
- protected procedure SetViewportWidth ( AValue : Integer ) ; override;
- protected procedure SetViewportHeight ( AValue : Integer ) ; override;
- protected procedure DoCreateRenderer ( ) ; override;
- protected procedure DoRendererResize ( ASize : TPoint; AScale : Single ) ; 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 ) ;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- 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 BeginRenderPassRendering ( AContext : TContext3D; AFill : TAlphaColor; ADepth : Single = 1 ; AStencil : Cardinal = $0 ) ; override;
- public procedure EndRenderPassRendering ( AContext : TContext3D ) ; 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.
- public procedure SetCenterOffsets
(
AFront :
Single; ABack :
Single; ALeft :
Single; ARight :
Single; ATop :
Single; ABottom :
Single
)
;
overload;
Configure camera center offsets for each side at once instead of single setting by published property.
- public procedure SetCenterOffsets
(
AOffset :
Single
)
;
overload;
Set a single value for each side as camera center offset value.
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 EmbeddedLight : TLight
Returns the internal light source (point light) to support lighting from render source point. This is very useful if light shines from another direction and it would appear black.
read GetEmbeddedLight - 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 : TMatrix3Dread FBiasMatrix
- 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 - published Target : TControl3D
- published UseEmbeddedLight : Boolean
- published CenterOffsetFront : Single
Get or set the internal render point offset for front side rendering.
read GetCenterOffset
write SetCenterOffset - published CenterOffsetBack : Single
Get or set the internal render point offset for back side rendering.
read GetCenterOffset
write SetCenterOffset - published CenterOffsetLeft : Single
Get or set the internal render point offset for left side rendering.
read GetCenterOffset
write SetCenterOffset - published CenterOffsetRight : Single
Get or set the internal render point offset for right side rendering.
read GetCenterOffset
write SetCenterOffset - published CenterOffsetTop : Single
Get or set the internal render point offset for top side rendering.
read GetCenterOffset
write SetCenterOffset - published CenterOffsetBottom : Single
Get or set the internal render point offset for bottom side rendering.
read GetCenterOffset
write SetCenterOffset