Gorilla.Controller
Unit Gorilla.Controller.pasClasses
- TGorillaController = class ( TComponent )
- TGorillaComponentController = class ( TGorillaController )
- TGorillaRenderPassMaterial = class ( TCustomMaterial )
- TGorillaRenderPassMaterialSource = class ( TMaterialSource )
- TGorillaIgnoredControl = class ( TCollectionItem )
- TGorillaIgnoredControls = class ( TOwnedCollection )
- TGorillaRenderPassController = class ( TGorillaController )
Enumerations
- enum TRenderPassEventState = ( OnPassBegin, OnPassEnd ) ;
Constants
Mics. types
- type TGorillaRenderPassControllerClass = class of TGorillaRenderPassController;
TGorillaController
TGorillaComponentController
Ancestors
Members
TGorillaRenderPassMaterial
Ancestors
Members
TGorillaRenderPassMaterialSource
Ancestors
Members
Fields
- protected FOwnerPass :
TGorillaRenderPassController
- protected FInputPass :
TGorillaRenderPassController
- protected FHasMaterial :
Boolean
Methods
- public constructor Create ( AOwnerPass : TGorillaRenderPassController ) ;
- protected procedure SetInputPass ( const AValue : TGorillaRenderPassController ) ; virtual;
- protected procedure DoPassesChanged ( Sender : TObject ) ; abstract virtual;
- public procedure PassesChanged ( Sender : TObject ) ;
Properties
TGorillaIgnoredControl
The ignored control is linked to a component at designtime, to exclude it from rendering by a specific render pass.
Ancestors
Members
Fields
Methods
- protected function GetDisplayName ( ) : string ; override;
- protected procedure SetDisplayName ( const AValue : string ) ; override;
- protected procedure AssignTo ( Dest : TPersistent ) ; override;
- public procedure Notification ( AComponent : TComponent; Operation : TOperation ) ;
Properties
TGorillaIgnoredControls
The ignored controls collections is a list of component manageable at design time, to exclude them from rendering by a specific render pass.
Ancestors
Members
TGorillaRenderPassController
Custom render pass controller. Extend this class for your own individual render pass. Render pass controller support different types: pre, post and intermediate Pre - the render pass will be executed before the main loop Post - the render pass will be executed after the main loop Intermediate - the render pass will be executed inside the main loop Caution: each render pass needs a unique ID, otherwise it will overwrite an existing render pass.
Ancestors
Members
Fields
- private FRectVBuffer :
TVertexBuffer
- private FRectIBuffer :
TIndexBuffer
- private FRectLastSize :
TPoint
- protected FId :
string
- protected FType :
TRenderPassType
- protected FViewport :
TGorillaViewport
- protected FRenderProc :
TRenderPassRenderingProc
- protected FOwnsRenderer :
Boolean
- protected FRendererType :
TRendererType
- protected FRendererFlags :
TRendererFlags
- protected FRenderer :
TRenderer
- protected FPreviousRenderer :
TRenderer
- protected FOverwriteColor :
Boolean
- protected FBackgroundColor :
TAlphaColor
- protected FShader :
TGorillaRenderPassMaterialSource
- protected FIterations :
Integer
- protected FMethod :
TRenderPassMethod
- protected FBlendings :
TBlendSettings
- protected FPrevViewMatrix :
TMatrix3D
- protected FPrevProjMatrix :
TMatrix3D
- protected FViewMatrix :
TMatrix3D
- protected FRecalcViewMatrix :
Boolean
- protected FProjMatrix :
TMatrix3D
- protected FRecalcProjMatrix :
Boolean
- protected FTextureMatrix :
TMatrix3D
- protected FBiasMatrix :
TMatrix3D
- protected FViewportSize :
TPoint
- protected FOverwriteViewportSize :
Boolean
- protected FUseRealViewportSize :
Boolean
- protected FScaleViewportSize :
Boolean
- protected FViewportScale :
Single
- protected FIgnoredControls :
TGorillaIgnoredControls
- protected FOnBeginSetup :
TRenderPassEvent
- protected FOnEndSetup :
TRenderPassEvent
- protected FOnBeginRender :
TRenderPassEvent
- protected FOnEndRender :
TRenderPassEvent
Methods
- public constructor Create ( AOwner : TComponent; const AId : string ) ;
- public destructor Destroy ( ) ;
- protected procedure DoSetViewportSize ( AViewport : TComponent ) ;
- protected function GetIgnoredControls ( ) : TGorillaIgnoredControls ;
- protected procedure SetIgnoredControls ( const AValue : TGorillaIgnoredControls ) ;
- protected procedure DoCreateRenderer ( ) ; virtual;
- protected procedure DoOnCreateCompositeTexture ( ASender : TObject; const ASize : TPoint; const AScale : Single; out ATexture : TGorillaTextureBitmap ) ; virtual;
- protected procedure SetRendererType ( const AValue : TRendererType ) ; virtual;
- protected function GetFBO ( ) : TFrameBufferObject ;
- protected function GetFBOTexture ( ) : TGorillaTextureBitmap ;
- protected function GetShader ( ) : TGorillaRenderPassMaterialSource ; virtual;
- protected procedure SetShader ( const AValue : TGorillaRenderPassMaterialSource ) ; virtual;
- protected procedure DoUnregisterRenderPassInContext ( AOldId : string; ANewId : string ) ; virtual;
- protected procedure SetId ( const AValue : string ) ;
- protected procedure SetType ( const AValue : TRenderPassType ) ;
- protected procedure SetViewport ( const AValue : TGorillaViewport ) ;
- protected procedure SetViewportSize ( AValue : TPoint ) ;
- protected function GetViewportWidth ( ) : Integer ;
- protected procedure SetViewportWidth ( AValue : Integer ) ;
- protected function GetViewportHeight ( ) : Integer ;
- protected procedure SetViewportHeight ( AValue : Integer ) ;
- protected procedure ApplyBackgroundColor ( ) ;
- protected procedure SetOverwriteColor ( AValue : Boolean ) ;
- protected procedure SetBackgroundColor ( AValue : TAlphaColor ) ;
- protected procedure DoOnBeginRenderPassSetup ( const ACount : Integer; const APass : TRenderPass ) ; virtual;
- protected procedure DoOnEndRenderPassSetup ( const ACount : Integer; const APass : TRenderPass ) ; virtual;
- protected procedure DoOnBeginRenderPassEvent ( const AContext : TContext3D; const ACount : Integer; const APass : TRenderPass ) ;
- protected procedure DoOnEndRenderPassEvent ( const AContext : TContext3D; const ACount : Integer; const APass : TRenderPass ) ;
- protected procedure DoSetupTexturesByViewport ( const AContext : TContext3D; const AWidth : Integer; const AHeight : Integer ) ; virtual;
- protected procedure DoSetupTextures ( ) ;
- protected procedure DoCreateIgnoredControls ( ) ; virtual;
- protected function CreateMaterialSource ( ) : TGorillaRenderPassMaterialSource ; abstract virtual;
- protected procedure Preset ( ) ; virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- protected procedure DefineProperties ( Filer : TFiler ) ; override;
- public procedure AfterConstruction ( ) ; override;
- public function IsInternalRenderPass ( ) : Boolean ; class virtual;
- public procedure UpdateOnResize ( ) ; virtual;
- public procedure UpdateRenderPass ( ) ; virtual;
- public function CreateRenderPassInstance ( const AContext : TContext3D ) : TRenderPass ; virtual;
- public procedure SetViewportSizeAndScaleWithoutResize ( AViewport : TComponent; ASize : TPoint; AScale : Single ) ;
- public procedure SetInputPass
(
const
APass :
TGorillaRenderPassController
)
;
virtual;
If you wish to concatenate render passes to each other, use this method to link the output of render pass #1 to input texture of render pass #2
- public function GetInputPass
(
)
: TGorillaRenderPassController
;
virtual;
Returns the currently set input pass.
- public procedure RenderToContext
(
const
AContext :
TContext3D; const
ATexture :
TTexture; const
ARect :
TRect; const
ADstPos :
TPoint
)
;
Renders to the applied context rect. This method requires an attached render pass shader material source.
- public function ComputeRenderingSize ( const AContext : TContext3D; const AWidth : Integer = $0 ; const AHeight : Integer = $0 ) : TPoint ;
- public function GetCurrentModelViewProjectionMatrix
(
)
: TMatrix3D
;
virtual;
Returns the current model view project matrix in dependecy of GetViewMatrix() and GetProjectionMatrix() settings.
- public procedure IgnoreControl
(
ACtrl :
TControl3D
)
;
virtual;
For some renderpasses it is necessary to define controls that need to be ignored for rendering the specific renderpass. Imagine a refraction renderpass, where the water plane itself shouldn't be rendered, because it would be empty.
- public function IsControlIgnored
(
ACtrl :
TControl3D
)
: Boolean
;
virtual;
Checks if a specific Control3D is in ignored list and returns TRUE if found.
- public function GetOutputTexture
(
)
: TTexture
;
virtual;
Returns the output texture of the specific render pass
- public function GetTextureMatrix
(
AContext :
TContext3D; const
AUseBias :
Boolean
=
False
)
: TMatrix3D
;
virtual;
It is recommended to overwrite this method. You should handle texture matrix yourself, depending on work done by render pass.
- public procedure BeginRenderPassRendering ( AContext : TContext3D; AFill : TAlphaColor; ADepth : Single = 1 ; AStencil : Cardinal = $0 ) ; virtual;
- public procedure EndRenderPassRendering ( AContext : TContext3D ) ; virtual;
- public function GetViewMatrix ( ) : TMatrix3D ; overload virtual;
- public function GetViewMatrix ( const AContext : TContext3D ) : TMatrix3D ; overload virtual;
- public function GetProjectionMatrix ( ) : TMatrix3D ; overload virtual;
- public function GetProjectionMatrix ( const AContext : TContext3D ) : TMatrix3D ; overload virtual;
Properties
- public Shader : TGorillaRenderPassMaterialSource
- public RendererType : TRendererType
- public Renderer : TRenderer
- public PreviousRenderer : TRenderer
The render pass component stores the previous renderer used in a property, when setting its renderer as current one.
read FPreviousRenderer - public RendererFlags : TRendererFlags
- public FBO : TFrameBufferObject
Represents the frame buffer object used by the render pass. By frame buffer objects we can buffer render stages in a separate texture to forward them to further render passes or for compositing.
read GetFBO - public FBOTexture : TGorillaTextureBitmap
- public ViewportSize : TPoint
Render passes can use a different viewport size for rendering. Very useful f.e. for shadow mapping depth pass rendering.
read FViewportSize
write SetViewportSize - public ProjMatrix : TMatrix3D
- public ViewMatrix : TMatrix3D
- public PrevViewMatrix : TMatrix3D
- public PrevProjMatrix : TMatrix3D
- published Id : string
- published _Type : TRenderPassType
- published Method : TRenderPassMethod
- published RenderProc : TRenderPassRenderingProc
- published Viewport : TGorillaViewport
- published OutputTexture : TTexture
The output texture depends on the render pass setting. The context or the FBOTexture could be possible output destinations. Override the GetOuputTexture() method for individual handling.
read GetOutputTexture - published Iterations : Integer
Defines how many times per execution this renderpass will be executed. This is useful to handle ping-pong algorithms like blurring.
read FIterations
write FIterations - published ViewportWidth : Integer
Render passes can use a different viewport size for rendering. Very useful f.e. for shadow mapping depth pass rendering. By this property we can set the viewport width in the ViewportSize structure.
read GetViewportWidth
write SetViewportWidth - published ViewportHeight : Integer
Render passes can use a different viewport size for rendering. Very useful f.e. for shadow mapping depth pass rendering. By this property we can set the viewport height in the ViewportSize structure.
read GetViewportHeight
write SetViewportHeight - published OverwriteViewportSize : Boolean
Only if OverwriteViewportSize is TRUE the individual viewport size of this render pass will be used.
read FOverwriteViewportSize
write FOverwriteViewportSize - published ScaleViewportSize : Boolean
If "OverwriteViewportSize" is TRUE and this property is TRUE, the ComputeRenderingSize() method will scale the configured FViewportSize. If "OverwriteViewportSize" is FALSE and this property is TRUE, the ComputeRenderingSize() method will scale the supplied width and height.
read FScaleViewportSize
write FScaleViewportSize - published ViewportScale : Single
In case "ScaleViewportSize" is activated, this factor will multiply the current viewport size to increase rendering area.
read FViewportScale
write FViewportScale - published OverwriteColor : Boolean
To use an individual background color for the renderpass different from the linked viewport, we can set OverwriteColor to TRUE.
read FOverwriteColor
write SetOverwriteColor - published BackgroundColor : TAlphaColor
If OverwriteColor is set to TRUE, the render pass uses this background color instead of the linked viewport background color.
read FBackgroundColor
write SetBackgroundColor - published IgnoredControls : TGorillaIgnoredControls
Get or set collection of ignored controls for rendering this render pass.
read GetIgnoredControls
write SetIgnoredControls