Gorilla.Controller
Unit Gorilla.Controller.pasClasses
- TGorillaController = class ( TComponent )
- TGorillaComponentController = class ( TGorillaController )
- TGorillaRenderPassMaterial = class ( TCustomMaterial )
- TGorillaRenderPassMaterialSource = class ( TMaterialSource )
- TGorillaRenderPassController = class ( TGorillaController )
Enumerations
- enum TRenderPassEventState = ( OnPassBegin, OnPassEnd ) ;
Constants
Mics. types
- type TGorillaRenderPassControllerClass = class of TGorillaRenderPassController;
TGorillaController
TGorillaComponentController
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
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
- protected FId :
string
- protected FType :
TRenderPassType
- protected FViewport :
TGorillaViewport
- protected FFBO :
TFrameBufferObject
- protected FFBOTexture :
TGorillaTextureBitmap
- protected FShader :
TGorillaRenderPassMaterialSource
- protected FIterations :
Integer
- protected FRenderer :
TRenderPassRendering
- protected FMethod :
TRenderPassMethod
- protected FBlending :
TBlendSetting
- 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 :
TList<FMX.Controls3D.TControl3D>
Methods
- public constructor Create ( AOwner : TComponent; const AId : string ) ;
- public destructor Destroy ( ) ;
- protected function GetShader ( ) : TGorillaRenderPassMaterialSource ; virtual;
- protected procedure SetShader ( const AValue : TGorillaRenderPassMaterialSource ) ; virtual;
- protected procedure SetId ( const Value : string ) ;
- protected procedure SetType ( const Value : TRenderPassType ) ;
- protected procedure SetViewport ( const Value : 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 DoOnRenderPass ( const AContext : TContext3D; const ACount : Integer; const AState : TRenderPassEventState; 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 ( const AContext : TContext3D ) ;
- protected function CreateMaterialSource ( ) : TGorillaRenderPassMaterialSource ; abstract virtual;
- protected function GetViewMatrix ( const AContext : TContext3D ) : TMatrix3D ; virtual;
- protected function GetProjectionMatrix ( const AContext : TContext3D ) : TMatrix3D ; virtual;
- public procedure Loaded ( ) ; 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 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
(
const
AContext :
TContext3D
)
: 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.
Properties
- public Shader : TGorillaRenderPassMaterialSource
- 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 FFBO - 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
- published Id : string
- published _Type : TRenderPassType
The render pass type defines the moment of execution, wether it will be run before, after or intermediatly. 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
read FType
write SetType - 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 Renderer : TRenderPassRendering
- published Method : TRenderPassMethod
- 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