Gorilla.Controller.Passes.Voxelize
Unit Gorilla.Controller.Passes.Voxelize.pasClasses
- TVoxelizeMaterial = class ( TGorillaRenderPassMaterial )
- TVoxelizeMaterialSource = class ( TGorillaRenderPassMaterialSource )
- TGorillaRenderPassVoxelize = class ( TGorillaRenderPassController )
- TGorillaRenderPassEmbeddedVoxelize = class ( TGorillaRenderPassVoxelize )
Records
- record TVoxelLight
- record TVoxelMaterial
- record TVoxelizeShaderData
Constants
- const VOXEL_MAX_LIGHTS : Integer = $8;
- const VOXEL_LOD : Integer = $8;
TVoxelLight
Fields
- public LightType :
Integer
- public Reserved1 :
- public Position :
TVector3D
- public Direction :
TVector3D
- public Ambient :
TAlphaColorF
- public Diffuse :
TAlphaColorF
- public Specular :
TAlphaColorF
- public Scattering :
TVector3D
- public SpotCutoff :
Single
- public SpotCosCutoff :
Single
- public SpotExponent :
Single
- public ConstantAttenuation :
Single
- public LinearAttenuation :
Single
- public QuadraticAttenuation :
Single
- public Intensity :
Single
- public Enabled :
Integer
Methods
TVoxelizeMaterial
Ancestors
Members
Fields
- protected FGeometryShader :
TContextShader
- protected FSceneScale :
Single
- protected FVoxelCenter :
TPoint3D
- protected FFocalLength :
Single
- protected FParamsInitialized :
Boolean
- protected FVoxelizeParams :
TVoxelizeShaderData
Methods
- public constructor Create ( ASource : TVoxelizeMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected function GetTextureOffset ( ) : TPoint3D ;
- protected procedure SetTextureOffset ( const AValue : TPoint3D ) ;
- protected procedure DoUpdateShaderUniformBuffers ( const Context : TContext3D; AProgram : TShaderProgram ) ;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoInitialize ( ) ; override;
Properties
TVoxelizeMaterialSource
Ancestors
Members
TGorillaRenderPassVoxelize
A render-pass component to used for voxelizing a scenery. The render pass will render the scene currently 6 times to produce 6 levels of detail. All levels of detail will be stored in a single 3D texture but shifted on the z-axis. So the size of the 3D texture is SIZE * SIZE * (SIZE * 6). This is much faster than setting up a octree of voxels but less accurate.
Ancestors
Members
Fields
- private FBiasMatrix :
TMatrix3D
- protected FVoxels :
TGorillaTextureBitmap
- protected FVoxelSize :
Integer
Methods
- public constructor Create ( AOwner : TComponent; const AId : string = Voxelize ) ;
- public destructor Destroy ( ) ;
- protected function GetVoxelSize ( ) : Integer ;
- protected procedure SetVoxelSize ( const AValue : Integer ) ;
- protected function GetVoxelCenter ( ) : TPoint3D ;
- protected function GetFocalLength ( ) : Single ;
- protected procedure SetFocalLength ( const AValue : Single ) ;
- protected function CreateMaterialSource ( ) : TGorillaRenderPassMaterialSource ; override;
- 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 procedure DoOnUpdateRenderPassInstance ( ARenderPass : TRenderPass ) ; override;
- protected procedure DoOnApplyMaterial ( AOriginal : TMaterial; ANew : TMaterial ) ;
- public procedure AfterConstruction ( ) ; override;
- public function IsPrimitivesKindSupported ( AKind : TPrimitivesKind ) : Boolean ; override;
- public function GetVoxelSizeFromDetail ( AContext : TContext3D; var ADetail : Integer ) : Integer ; static;
- 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 GetTextureMatrix ( AContext : TContext3D; const AUseBias : Boolean = True ) : TMatrix3D ; override;
- public function GetTexture3D ( ) : TTexture ;
- public function GetOutputTexture ( ) : TTexture ; override;
- public procedure EndRenderPassRendering ( AContext : TContext3D ) ; override;
Properties
- public BiasMatrix : TMatrix3Dread FBiasMatrix
- public VoxelCenter : TPoint3Dread GetVoxelCenter
- published VoxelSize : Integer
Get or set the size of a voxel block inside of the voxel structur. All values getting adjusted to a multiple of 32 in a range from [32..512]. Larger values than 512 making no sense due to memory consumption and and slow voxelization. For elder GPUs we recommend a size of 64, modern GPUs may run well with 128 or 256. Larger values are only recommended for high-end GPU machines.
read GetVoxelSize
write SetVoxelSize - published FocalLength : Single
To influence the level of detail selection in final voxel cone tracing, you're allowed
read GetFocalLength
write SetFocalLength
TGorillaRenderPassEmbeddedVoxelize
In the TCompositeRenderer an embedded version of the voxelization render pass is needed, marked by the overwritten IsInternalRenderPass routine.