Gorilla.Renderer
Unit Gorilla.Renderer.pasClasses
- TRenderer = class ( TObject )
- TLegacyRenderer = class ( TRenderer )
- TCompositeRenderer = class ( TRenderer )
- TForwardRenderer = class ( TCompositeRenderer )
- TDeferredRenderer = class ( TCompositeRenderer )
Enumerations
- enum TRendererType = ( ForwardRenderer, LegacyRenderer ) ;
- enum TRendererFlag = ( IgnoreRenderTargets, IgnoreCompositeCtrl, IgnoreEmissiveBlur, IgnoreGlobalIllum ) ;
Constants
TRendererType
The renderer type defines the kind of rendering pipelines.
TRendererFlag
Rendererer flags allow to control certain parts in a rendering pipeline.
Remarks
IgnoreRenderTargets - will prevent the renderer to create rendertargets. f.e. the forward renderer will create render targets for: albedo, translucent-albedo, alpha, positions, normals and emissive channel.
IgnoreCompositeCtrl - will prevent the renderer to create the embedded compositing render pass, which combines default render targets to a final image.
IgnoreEmissiveBlur - will prevent the renderer to create the embedded emissive blur render pass, which produces a blurred version of the previous emissive render target.
IgnoreGlobalIllum - will prevent the renderer to create the embedded global illumination render pass. It f.e. produces shadows or reflections.
TRenderer
Basis renderer class for all types of renderer.
Ancestors
Members
Fields
- protected FId :
string
- protected FFlags :
TRendererFlags
- protected FMultisample :
TMultisample
- protected FSharedContext :
TContext3D
- protected FRenderTargets :
TRenderTargets
- protected FCompositeTexture :
TGorillaTextureBitmap
- protected FOwner :
TComponent
- protected FSize :
TPoint
- protected FScale :
Single
- protected FColor :
TAlphaColorF
- protected FOnCreateCompositeTexture :
TOnRendererCreateCompositeTexture
Methods
- public constructor Create ( AId : string; AOwner : TComponent; AFlags : TRendererFlags = [] ; ACompositeTextureEvent : TOnRendererCreateCompositeTexture = nil ) ;
- public destructor Destroy ( ) ;
- protected function GetDefaultFrameBuf ( ) : TFrameBufferObject ;
- protected function GetTranslucentBuf ( ) : TFrameBufferObject ;
- protected procedure SetSize ( const AValue : TPoint ) ; virtual;
- protected procedure SetScale ( const AValue : Single ) ; virtual;
- protected procedure SetColor ( const AValue : TAlphaColorF ) ; virtual;
- protected procedure DoResize ( const ASize : TPoint; const AScale : Single ) ; virtual;
- protected procedure DoCreateContext ( ) ; virtual;
- protected procedure DoDestroyContext ( ) ;
- protected function DoCreateCompositeTexture ( ) : TTexture ; virtual;
- protected procedure DoCreateTextures ( ) ; virtual;
- protected procedure DoDestroyTextures ( AIsDestructing : Boolean ) ; virtual;
- protected procedure DoApply ( ) ; virtual;
- public procedure Resize ( const ASize : TPoint; const AScale : Single ) ;
- public procedure Apply ( ) ; virtual;
- public procedure Reset ( ) ; virtual;
- public procedure BeginMainRenderPass ( ACamera : TMatrix3D; AAngleOfView : Single ) ; virtual;
- public procedure EndMainRenderPass ( ) ; virtual;
- public function BeginOpaqueRendering ( ) : Boolean ; virtual;
- public procedure EndOpaqueRendering ( ) ; virtual;
- public function BeginTranslucentRendering ( ) : Boolean ; virtual;
- public procedure EndTranslucentRendering ( ) ; virtual;
Properties
- public Id : stringread FId
- public Flags : TRendererFlagsread FFlags
- public SharedContext : TContext3Dread FSharedContext
- public CompositeTexture : TGorillaTextureBitmapread FCompositeTexture
- public RenderTargets : TRenderTargets
- public Owner : TComponent
- public Size : TPoint
- public Scale : Single
- public Color : TAlphaColorF
- public DefaultFrameBuf : TFrameBufferObjectread GetDefaultFrameBuf
- public TranslucentBuf : TFrameBufferObjectread GetTranslucentBuf
TLegacyRenderer
Ancestors
Members
Methods
- public constructor Create ( AId : string; AOwner : TComponent; AFlags : TRendererFlags = [] ; ACompositeTextureEvent : TOnRendererCreateCompositeTexture = nil ) ;
- public destructor Destroy ( ) ;
- protected function DoCreateCompositeTexture ( ) : TTexture ; override;
- public procedure BeginMainRenderPass ( ACamera : TMatrix3D; AAngleOfView : Single ) ; override;
- public procedure EndMainRenderPass ( ) ; override;
- public function BeginOpaqueRendering ( ) : Boolean ; override;
- public procedure EndOpaqueRendering ( ) ; override;
- public function BeginTranslucentRendering ( ) : Boolean ; override;
- public procedure EndTranslucentRendering ( ) ; override;
TCompositeRenderer
Basis renderer for forward and deferred renderer with WBOIT 3-phase rendering.
Ancestors
Members
Fields
- protected FAlbedoTexture :
TTexture
- protected FTranslucentAlbedoTexture :
TTexture
- protected FAlphaTexture :
TTexture
- protected FPositionTexture :
TTexture
- protected FNormalsTexture :
TTexture
- protected FEmissiveTexture :
TTexture
- protected FVoxelizeCtrl :
TObject
- protected FVoxelizePass :
TRenderPass
- protected FGlobalIllumCtrl :
TObject
- protected FGlobalIllumPass :
TRenderPass
- protected FGlobalIllumBlurCtrl :
TObject
- protected FGlobalIllumBlurPass :
TRenderPass
- protected FEmissiveBlurCtrl :
TObject
- protected FEmissiveBlurPass :
TRenderPass
- protected FDeferredCompositeCtrl :
TObject
- protected FDeferredCompositePass :
TRenderPass
- protected FFXAACtrl :
TObject
- protected FFXAAPass :
TRenderPass
- protected FTranslucentDistance :
Single
- protected FSaturation :
TPoint3D
- protected FEmissiveBlur :
Integer
- protected FGlobalIllumDetail :
Integer
- protected FGlobalIllumSoftness :
Single
- protected FShadowStrength :
Single
- protected FReflectionStrength :
Single
- protected FXAASteps :
Integer
Methods
- public constructor Create ( AId : string; AOwner : TComponent; AFlags : TRendererFlags = [] ; ACompositeTextureEvent : TOnRendererCreateCompositeTexture = nil ) ;
- public destructor Destroy ( ) ;
- protected procedure DoResize ( const ASize : TPoint; const AScale : Single ) ; override;
- protected procedure DoCreateContext ( ) ; override;
- protected procedure DoCreateEmbeddedCompositeRenderPass ( ) ; virtual;
- protected procedure DoCreateEmbeddedEmissiveBlurRenderPass ( ) ; virtual;
- protected procedure DoCreateEmbeddedGlobalIllumRenderPass ( ) ; virtual;
- protected procedure DoCreateEmbeddedFXAARenderPass ( ) ; virtual;
- protected procedure DoDestroyEmbeddedCompositeRenderPass ( AIsDestructing : Boolean ) ; virtual;
- protected procedure DoDestroyEmbeddedEmissiveBlurRenderPass ( AIsDestructing : Boolean ) ; virtual;
- protected procedure DoDestroyEmbeddedGlobalIllumRenderPass ( AIsDestructing : Boolean ) ; virtual;
- protected procedure DoDestroyEmbeddedFXAARenderPass ( AIsDestructing : Boolean ) ; virtual;
- protected procedure DoCreateTextures ( ) ; override;
- protected procedure DoDestroyTextures ( AIsDestructing : Boolean ) ; override;
- protected function DoRenderEmissiveBlur ( const ARenderContext : PRenderContext ) : TTexture ; virtual;
- protected procedure DoRenderGlobalIllum ( const ARenderContext : PRenderContext ) ; virtual;
- protected procedure DoRenderFXAA ( const ARenderContext : PRenderContext ) ; virtual;
- protected function GetTranslucentDistance ( ) : Single ;
- protected procedure SetTranslucentDistance ( const AValue : Single ) ;
- protected function GetSaturation ( ) : TPoint3D ;
- protected procedure SetSaturation ( const AValue : TPoint3D ) ;
- protected function GetEmissiveBlur ( ) : Integer ;
- protected procedure SetEmissiveBlur ( const AValue : Integer ) ;
- protected function GetGlobalIllumDetail ( ) : Integer ;
- protected procedure SetGlobalIllumDetail ( const AValue : Integer ) ;
- protected function GetGlobalIllumSoftness ( ) : Single ;
- protected procedure SetGlobalIllumSoftness ( AValue : Single ) ;
- protected function GetShadowStrength ( ) : Single ;
- protected procedure SetShadowStrength ( AValue : Single ) ;
- protected function GetReflectionStrength ( ) : Single ;
- protected procedure SetReflectionStrength ( AValue : Single ) ;
- protected function GetFXAA ( ) : Integer ;
- protected procedure SetFXAA ( AValue : Integer ) ;
- public function BeginOpaqueRendering ( ) : Boolean ; override;
- public procedure EndOpaqueRendering ( ) ; override;
- public procedure Composite ( const ARenderContext : PRenderContext ) ; virtual;
Properties
- public AlbedoTexture : TTexture
- public TranslucentAlbedoTexture : TTexture
Albedo color channel output texture (for translucent rendering only!).
read FTranslucentAlbedoTexture - public AlphaTexture : TTexture
- public PositionTexture : TTexture
- public NormalsTexture : TTexture
- public EmissiveTexture : TTexture
- public EmissiveBlurCtrl : TObject
Embedded emissive blur render pass controller, executed after regular opaque and translucent rendering is done. I will be executed before final composite render pass is executed.
read FEmissiveBlurCtrl - public GlobalIllumCtrl : TObject
Embedded global illumination render pass controller, executed before final compositing is done. It renders a global illumination texture including shadows and reflections.
read FGlobalIllumCtrl - public DeferredCompositeCtrl : TObject
Embedded composite render pass controller, executed after regular opaque and translucent rendering is done. I will be executed after emissive blurring was done.
read FDeferredCompositeCtrl - public TranslucentDistance : Single
Get or set translucent distance value used for weighting colors depending on their eye-vertex distance. The closer a pixel is, the bigger it weighted. By changing the distance value you can modify weight depending on your scene.
read GetTranslucentDistance
write SetTranslucentDistance - public Saturation : TPoint3D
Get or set saturation values applied while color merging. The 3D vector property contains of 3 parts for opaque, translucent and composite saturation. This allows you to fully control each part of the rendering. If value is zero no saturation algorithm will be applied to the specific part.
read GetSaturation
write SetSaturation - public EmissiveBlur : Integer
Get or set emissive rendering blurring intensity. This value has massive influence on performance. It controls the number of blurring iterations and the wideness of blurring. Setting this value to zero deactivates emissive blurring.
read GetEmissiveBlur
write SetEmissiveBlur - public GlobalIllumDetail : Integer
Defines the detail of rendering global illumination. You can set values between 0 (off) and 7 (highest). Setting this value will automatically adjust internal rendering settings for global illumination.
read GetGlobalIllumDetail
write SetGlobalIllumDetail - public GlobalIllumSoftness : Single
Get or set global illumination softening. Our GlobalIllumination implementation allows to to soften shadows and reflections depending on your scene settings.
read GetGlobalIllumSoftness
write SetGlobalIllumSoftness - public ShadowStrength : Single
Get or set the strength of shadowing. The larger the value, the more dark the shadows are.
read GetShadowStrength
write SetShadowStrength - public ReflectionStrength : Single
Get or set the strength/intensity of reflections in final GI computation.
read GetReflectionStrength
write SetReflectionStrength - public FXAA : Integer
TForwardRenderer
The old forward renderer with simple albedo, translucent-albedo and alpha texture.
Ancestors
Members
TDeferredRenderer
The new deferred renderer with multiple color channels combined together in a final composite render pass (embedded).
Ancestors
Members
Fields
- protected FComponentsTexture :
TTexture
- protected FAmbientTexture :
TTexture
- protected FSpecularTexture :
TTexture
Methods
- public constructor Create ( AId : string; AOwner : TComponent; AFlags : TRendererFlags = [] ; ACompositeTextureEvent : TOnRendererCreateCompositeTexture = nil ) ;
- public destructor Destroy ( ) ;
- protected procedure DoResize ( const ASize : TPoint; const AScale : Single ) ; override;
- protected procedure DoCreateTextures ( ) ; override;
- protected procedure DoDestroyTextures ( AIsDestructing : Boolean ) ; override;
- protected procedure DoApply ( ) ; override;
- public procedure Composite ( const ARenderContext : PRenderContext ) ; override;