Gorilla.Material.Default
Unit Gorilla.Material.Default.pasClasses
- TGorillaDefaultMaterialRef = class ( TPersistent )
- TGorillaDefaultMaterial = class ( TCustomMaterial )
- TGorillaDefaultMaterialSource = class ( TMaterialSource )
Records
- record TGorillaShaderPassData
- record TGorillaShaderData
Mics. types
- type PGorillaShaderData = pointer to TGorillaShaderData;
TGorillaShaderPassData
Fields
- public ShadowMapMatrix :
- public ReflectTextureMatrix :
TMatrix3D
- public RefractTextureMatrix :
TMatrix3D
- public ReflectionPower :
Single
- public RefractionPower :
Single
- public TranslucentDistance :
Single
- public NormalIntensity :
Single
- public ParallaxLevels :
Integer
- public PBRMetallic :
Single
- public PBRRoughness :
Single
- public PBRAO :
Single
TGorillaShaderData
Fields
- public ModelMatrix :
TMatrix3D
- public ModelViewProjectionMatrix :
TMatrix3D
- public ModelNormalMatrix :
TMatrix3D
- public ViewMatrix :
TMatrix3D
- public ProjectionMatrix :
TMatrix3D
- public TimeInfo :
TVector3D
- public EyePos :
TVector3D
- public ViewDir :
TPoint3D
- public ShadingModel :
Integer
- public Material :
- public Lights :
- public LightsCount :
Integer
- public Options :
Integer
- public ShadingIntensity :
Single
- public Brightness :
Single
- public FogMode :
Integer
- public FogDensity :
Single
- public FogStart :
Single
- public FogEnd :
Single
- public FogColor :
TAlphaColorF
- public FrustumMin :
TVector3D
- public FrustumMax :
TVector3D
- public SceneMin :
TVector3D
- public SceneMax :
TVector3D
- public BoundaryMin :
TVector3D
- public BoundaryMax :
TVector3D
- public ViewSize :
TVector3D
- public ClippingPlane :
TVector3D
- public PassData :
Methods
TGorillaDefaultMaterialRef
TGorillaDefaultMaterialRef is a helper class to reference to a TGorillaDefaultMaterial as TPersistent which is needed for OwnedCollections
Ancestors
Members
TGorillaDefaultMaterial
Defining a default basic material sourcce allowing to with render lambert / phong / blinnphong shading on basis of a diffuse color texture.
Remarks
The default material renders up to 8 lights of point / directional / spot light type depending on platform and GLES version used.
On Windows platform + OpenGLES v3 (10.3+) the forward renderer can take up to 8 lights.
On Windows platform + OpenGLES v2 (10.1 - 10.2) the forward renderer can take up to 4 lights.
On Android platform + OpenGLES v2 | v3 the forward renderer can take up to 4 lights.
On iOS platform + OpenGLES v2 | v3 the forward renderer can take up to 4 lights.
On MacOS platform + OpenGLES v3 (10.3+) the forward renderer can take up to 8 lights.
On MacOS platform + OpenGLES v2 (10.1 - 10.2) the forward renderer can take up to 4 lights.
Ancestors
Members
Fields
- protected FRef :
TGorillaDefaultMaterialRef
- protected FSource :
TGorillaDefaultMaterialSource
- protected FShaderData :
TGorillaShaderData
- protected FUseRefractionDepth :
Boolean
- protected FNormalIntensity :
Single
- protected FInverseNormalMapping :
Boolean
- protected FVSNode :
TGorillaGLSLVertexShader
- protected FVSShaderSource :
TContextShaderSource
- protected FVSVarIndex :
Integer
- protected FFSNode :
TGorillaGLSLFragmentShader
- protected FFSShaderSource :
TContextShaderSource
- protected FFSVarIndex :
Integer
- protected FErrorOnBuildingShader :
Boolean
- protected FUpdateShaderProgram :
Boolean
- protected FAllowTexture0 :
Boolean
- protected FAllowNormalMapTexture :
Boolean
- protected FAllowDisplacementMapTexture :
Boolean
- protected FAllowDepthTexture :
Boolean
- protected FAllowReflectionTexture :
Boolean
- protected FAllowRefractionTexture :
Boolean
- protected FAllowEnvironmentTexture :
Boolean
- protected FAllowShadowMapTexture :
Boolean
- protected FStopWatch :
TStopwatch
- protected FMeasureTime :
Boolean
- protected FTextures :
TGorillaTexturePool
- protected FShadows :
Boolean
- protected FShadowMethod :
TGorillaShadowMethod
- protected FReflections :
Boolean
- protected FRefractions :
Boolean
- protected FDepthMapping :
Boolean
- protected FEnvironment :
Boolean
Methods
- public constructor Create ( const ASource : TGorillaDefaultMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected function GetShadingModel ( ) : TGorillaShadingModel ; virtual;
- protected procedure SetShadingModel ( const AValue : TGorillaShadingModel ) ; virtual;
- protected function GetShadingIntensity ( ) : Single ; virtual;
- protected procedure SetShadingIntensity ( const AValue : Single ) ; virtual;
- protected function GetBrightness ( ) : Single ; virtual;
- protected procedure SetBrightness ( const AValue : Single ) ; virtual;
- protected procedure SetMeasureTime ( const AValue : Boolean ) ; virtual;
- protected function GetStartTime ( ) : Double ; virtual;
- protected procedure SetStartTime ( const AValue : Double ) ; virtual;
- protected function GetRenderTime ( ) : Double ; virtual;
- protected procedure SetRenderTime ( const AValue : Double ) ; virtual;
- protected function GetLastTime ( ) : Double ; virtual;
- protected procedure SetLastTime ( const AValue : Double ) ; virtual;
- protected function GetDeltaTime ( ) : Double ; virtual;
- protected function GetEmissive ( ) : TAlphaColorF ; virtual;
- protected procedure SetEmissive ( AValue : TAlphaColorF ) ; virtual;
- protected function GetDiffuse ( ) : TAlphaColorF ; virtual;
- protected procedure SetDiffuse ( AValue : TAlphaColorF ) ; virtual;
- protected function GetAmbient ( ) : TAlphaColorF ; virtual;
- protected procedure SetAmbient ( AValue : TAlphaColorF ) ; virtual;
- protected function GetSpecular ( ) : TAlphaColorF ; virtual;
- protected procedure SetSpecular ( AValue : TAlphaColorF ) ; virtual;
- protected function GetShininess ( ) : Single ; virtual;
- protected procedure SetShininess ( const AValue : Single ) ; virtual;
- protected function GetClippingColor ( ) : TAlphaColorF ; virtual;
- protected procedure SetClippingColor ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetUseLighting ( ) : Boolean ; virtual;
- protected procedure SetUseLighting ( const AValue : Boolean ) ; virtual;
- protected function GetUseSpecular ( ) : Boolean ; virtual;
- protected procedure SetUseSpecular ( const AValue : Boolean ) ; virtual;
- protected function GetUseTexturing ( ) : Boolean ; virtual;
- protected procedure SetUseTexturing ( const AValue : Boolean ) ; virtual;
- protected function GetUseTexture0 ( ) : Boolean ; virtual;
- protected procedure SetUseTexture0 ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRAlbedoTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRAlbedoTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRMetallicTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRMetallicTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRRoughnessTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRRoughnessTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRAOTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRAOTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBREmissiveTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBREmissiveTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRSpecularTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRSpecularTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUseVertexColor ( ) : Boolean ; virtual;
- protected procedure SetUseVertexColor ( const AValue : Boolean ) ; virtual;
- protected function GetUseColorClipping ( ) : Boolean ; virtual;
- protected procedure SetUseColorClipping ( const AValue : Boolean ) ; virtual;
- protected function GetNormalIntensity ( ) : Single ; virtual;
- protected procedure SetNormalIntensity ( const AValue : Single ) ; virtual;
- protected function GetInverseNormalMapping ( ) : Boolean ; virtual;
- protected procedure SetInverseNormalMapping ( const AValue : Boolean ) ; virtual;
- protected function GetParallaxLevels ( ) : Integer ; virtual;
- protected procedure SetParallaxLevels ( const AValue : Integer ) ; virtual;
- protected function GetAlphaCutoff ( ) : Single ; virtual;
- protected procedure SetAlphaCutoff ( const AValue : Single ) ; virtual;
- protected function GetUseAlphaCutoff ( ) : Boolean ; virtual;
- protected procedure SetUseAlphaCutoff ( const AValue : Boolean ) ; virtual;
- protected function GetMetallicBias ( ) : Single ; virtual;
- protected procedure SetMetallicBias ( const AValue : Single ) ; virtual;
- protected function GetRoughnessBias ( ) : Single ; virtual;
- protected procedure SetRoughnessBias ( const AValue : Single ) ; virtual;
- protected function GetAOBias ( ) : Single ; virtual;
- protected procedure SetAOBias ( const AValue : Single ) ; virtual;
- protected function GetNearLimit ( ) : Single ; virtual;
- protected procedure SetNearLimit ( const AValue : Single ) ; virtual;
- protected function GetFarLimit ( ) : Single ; virtual;
- protected procedure SetFarLimit ( const AValue : Single ) ; virtual;
- protected procedure SetShadows ( const AValue : Boolean ) ; virtual;
- protected procedure SetShadowMethod ( const AValue : TGorillaShadowMethod ) ; virtual;
- protected procedure SetDepthMapping ( const AValue : Boolean ) ; virtual;
- protected procedure SetReflections ( const AValue : Boolean ) ; virtual;
- protected procedure SetRefractions ( const AValue : Boolean ) ; virtual;
- protected procedure SetEnvironment ( const AValue : Boolean ) ; virtual;
- protected function GetReflectionPower ( ) : Single ; virtual;
- protected procedure SetReflectionPower ( const AValue : Single ) ; virtual;
- protected function GetRefractionPower ( ) : Single ; virtual;
- protected procedure SetRefractionPower ( const AValue : Single ) ; virtual;
- protected procedure DoApplyMaterial ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyInputTextures ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyLights ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyShadow ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyReflection ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyRefraction ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyDepth ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyEnvironmentMapping ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyMatrices ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyTime ( const Context : TContext3D ) ; virtual;
- protected procedure DoApplyFog ( const Context : TContext3D ) ; virtual;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected function DoOnCreateTextureShaderNode ( ABuilder : TObject; ATexture : TGorillaTexturePoolEntry; AId : string ) : TGorillaGLSLTextureUniformNode ; virtual;
- protected function DoGetTextureShaderVariables
(
const
AShaderKind :
TContextShaderKind; var
AVarIndex :
Integer
)
: TArray<FMX.Types3D.TContextShaderVariable>
;
virtual;
Returns an array of shader variables for all textures. The method will automatically handle separation of PoolTextures[]-Array and single textures.
- protected procedure RemoveShaderProgram ( ) ; virtual;
- protected procedure DoUpdateShaderProgram
(
)
;
virtual;
Calls RemoveShaderProgram() to destroy an already created shader. Afterwards it will setup again the vertex- and fragmentshader.
- protected procedure DoUpdateShaderUniformBuffers ( const Context : TContext3D; AProgram : TShaderProgram ) ; virtual;
- protected procedure DoCreateVertexShader
(
)
;
virtual;
Creates the vertex shader node builder.
- protected procedure DoSetupVertexShader
(
)
;
virtual;
Builds the vertex shader source code.
- protected procedure DoUpdateVertexShader ( ) ; virtual;
- protected procedure DoCreateFragmentShader
(
)
;
virtual;
Creates the fragment shader node builder.
- protected procedure DoSetupFragmentShader
(
)
;
virtual;
Builds the fragment shader source code.
- protected procedure DoUpdateFragmentShader ( ) ; virtual;
- protected procedure DoCheckDefaultTextureFlags
(
)
;
virtual;
Checks shader source definitions and updates the allowed bitmap flags.
- protected procedure DoCreateTexturePool
(
)
;
virtual;
Creates the TGorillaTexturePool instance.
- protected procedure DoGetTexturesFromBitmapPool
(
const
APool :
TGorillaBitmapPool
)
;
virtual;
Reads all texture bitmaps from material source and fills the texture pool.
- protected procedure DoInitialize ( ) ; override;
- protected procedure DoChange ( ) ; override;
- public function FindTexturePoolEntryByName ( const AName : string ) : TGorillaTexturePoolEntry ; virtual;
Properties
- public Ref : TGorillaDefaultMaterialRefread FRef
- public Textures : TGorillaTexturePoolread FTextures
- public VertexShaderNode : TGorillaGLSLVertexShader
- public FragmentShaderNode : TGorillaGLSLFragmentShader
- public MeasureTime : Boolean
Get or Activate/Deactivate time measurement. Some shaders may need time information between render cycles to render properly.
read FMeasureTime
write SetMeasureTime - public StartTime : Double
- public RenderTime : Double
Returns the time of the current render cycle, if MeasureTime is set to TRUE.
read GetRenderTime
write SetRenderTime - public LastTime : Double
Returns the time of the previous render cycle, if MeasureTime is set to TRUE.
read GetLastTime
write SetLastTime - public DeltaTime : Double
- public ShadingModel : TGorillaShadingModel
Get or set the used shading model. You can choose between Lambert, Phong or Blinnphong shading algorithm.
read GetShadingModel
write SetShadingModel - public ShadingIntensity : Single
Get or set the shading intensity value, applied to diffuse and specular color.
read GetShadingIntensity
write SetShadingIntensity - public Brightness : Single
Get or set the brightness intensity value, applied to diffuse.
read GetBrightness
write SetBrightness - public Emissive : TAlphaColorF
- public Diffuse : TAlphaColorF
- public Ambient : TAlphaColorF
- public Specular : TAlphaColorF
- public Shininess : Single
- public ClippingColor : TAlphaColorF
Get or set clipping color. If UseColorClipping is enabled, RGB is used as color to be clipped and A is used as tolerance.
read GetClippingColor
write SetClippingColor - public UseLighting : Boolean
Enable or disable lighting shading model computation in shader.
read GetUseLighting
write SetUseLighting - public UseSpecular : Boolean
Enable or disable specular lighting for shading model computation in shader.
read GetUseSpecular
write SetUseSpecular - public UseTexturing : Boolean
Enable or disable general texturing functionality. _Texture0 will not directly be used
read GetUseTexturing
write SetUseTexturing - public UseTexture0 : Boolean
Enable or disable general texturing functionality and _Texture0 variable.
read GetUseTexture0
write SetUseTexture0 - public UseVertexColor : Boolean
Enable or disable to use color rendering (on texture or not).
read GetUseVertexColor
write SetUseVertexColor - public UseColorClipping : Boolean
- public AlphaCutoff : Single
Get or set alpha cutoff value. If UseAlphaCutoff is enabled, fragments are discarded depending on the alpha channel value.
read GetAlphaCutoff
write SetAlphaCutoff - public UseAlphaCutoff : Boolean
- public UsePBRAlbedoTexture : Boolean
Enable or disable PBR (physically based rendering) albedo texture usage. If property is FALSE, the shader uses diffuse color as albedo color.
read GetUsePBRAlbedoTexture
write SetUsePBRAlbedoTexture - public UsePBRMetallicTexture : Boolean
Enable or disable PBR (physically based rendering) albedo texture usage. If property is FALSE, the shader uses the PBRMetallicBias value.
read GetUsePBRMetallicTexture
write SetUsePBRMetallicTexture - public UsePBRRoughnessTexture : Boolean
Enable or disable PBR (physically based rendering) albedo texture usage. If property is FALSE, the shader uses the PBRRoughnessBias value.
read GetUsePBRRoughnessTexture
write SetUsePBRRoughnessTexture - public UsePBRAOTexture : Boolean
Enable or disable PBR (physically based rendering) ambient occlusion texture usage. If property is FALSE, the shader uses the PBRAOBias value.
read GetUsePBRAOTexture
write SetUsePBRAOTexture - public UsePBREmissiveTexture : Boolean
Enable or disable PBR (physically based rendering) emissive texture usage. If property is FALSE, the shader uses the material emissive color value only.
read GetUsePBREmissiveTexture
write SetUsePBREmissiveTexture - public UsePBRSpecularTexture : Boolean
Enable or disable PBR (physically based rendering) specular texture usage. Of property is FALSE, the shader uses the material specular color value only.
read GetUsePBRSpecularTexture
write SetUsePBRSpecularTexture - public NormalIntensity : Single
Get or set normal mapping / parallax occulusion mapping intensity.
read GetNormalIntensity
write SetNormalIntensity - public InverseNormalMapping : Boolean
Enable/Disable inverse direction of normal mapping / parallax occlusion mapping. Valid values are 1 or -1.
read GetInverseNormalMapping
write SetInverseNormalMapping - public ParallaxLevels : Integer
Get or set the number of levels for parallax occlusion mapping computation. Values between 4 and 256 are allowed.
read GetParallaxLevels
write SetParallaxLevels - public MetallicBias : Single
Get or set bias value for metallic component in physically based rendering.
read GetMetallicBias
write SetMetallicBias - public RoughnessBias : Single
Get or set bias value for roughness component in physically based rendering.
read GetRoughnessBias
write SetRoughnessBias - public AOBias : Single
- public NearLimit : Single
- public FarLimit : Single
Defines the camera frustum far limit value. This value is used by raytracing shadow computation and can be changed to increase performance. The value should not be higher than 1000.0 otherwise raytracing performance will increase a lot.
read GetFarLimit
write SetFarLimit - public Shadows : Boolean
- public ShadowMethod : TGorillaShadowMethod
Get or set the used shadow method in shader. This property only has effect if "Shadows" is set to true.
read FShadowMethod
write SetShadowMethod - public Reflections : Boolean
Activates / Deactivates the reflection computation of default shader.
read FReflections
write SetReflections - public Refractions : Boolean
Activates / Deactivates the refraction computation of default shader.
read FRefractions
write SetRefractions - public ReflectionPower : Single
Defines the factor of mixing reflection with the basically computed color.
read GetReflectionPower
write SetReflectionPower - public RefractionPower : Single
Defines the factor of mixing refraction with the basically computed color.
read GetRefractionPower
write SetRefractionPower - public Environment : Boolean
Activates / Deactivates environment mapping computation of default shader.
read FEnvironment
write SetEnvironment
TGorillaDefaultMaterialSource
Defining a default basic material sourcce allowing to with render lambert / phong / blinnphong shading on basis of a diffuse color texture.
Remarks
Use this material source as basis for further complex material renderer.The default material renders up to 8 lights of point / directional / spot light type depending on platform and GLES version used.
On Windows platform + OpenGLES v3 (10.3+) the forward renderer can take up to 8 lights.
On Windows platform + OpenGLES v2 (10.1 - 10.2) the forward renderer can take up to 4 lights.
On Android platform + OpenGLES v2 | v3 the forward renderer can take up to 4 lights.
On iOS platform + OpenGLES v2 | v3 the forward renderer can take up to 4 lights.
On MacOS platform + OpenGLES v3 (10.3+) the forward renderer can take up to 8 lights.
On MacOS platform + OpenGLES v2 (10.1 - 10.2) the forward renderer can take up to 4 lights.
Ancestors
Members
Fields
- protected FContextResetOvrId :
Integer
- protected FBitmaps :
TGorillaBitmapPool
- protected FInputs :
TGorillaInputRenderPassMap
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetMeasureTime ( ) : Boolean ; virtual;
- protected procedure SetMeasureTime ( const AValue : Boolean ) ; virtual;
- protected function GetEmissiveF ( ) : TAlphaColorF ; virtual;
- protected procedure SetEmissiveF ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetAmbientF ( ) : TAlphaColorF ; virtual;
- protected procedure SetAmbientF ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetDiffuseF ( ) : TAlphaColorF ; virtual;
- protected procedure SetDiffuseF ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetSpecularF ( ) : TAlphaColorF ; virtual;
- protected procedure SetSpecularF ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetClippingColorF ( ) : TAlphaColorF ; virtual;
- protected procedure SetClippingColorF ( const AValue : TAlphaColorF ) ; virtual;
- protected function GetEmissive ( ) : TAlphaColor ; virtual;
- protected procedure SetEmissive ( const AValue : TAlphaColor ) ; virtual;
- protected function GetAmbient ( ) : TAlphaColor ; virtual;
- protected procedure SetAmbient ( const AValue : TAlphaColor ) ; virtual;
- protected function GetDiffuse ( ) : TAlphaColor ; virtual;
- protected procedure SetDiffuse ( const AValue : TAlphaColor ) ; virtual;
- protected function GetSpecular ( ) : TAlphaColor ; virtual;
- protected procedure SetSpecular ( const AValue : TAlphaColor ) ; virtual;
- protected function GetShininess ( ) : Single ; virtual;
- protected procedure SetShininess ( const AValue : Single ) ; virtual;
- protected function GetClippingColor ( ) : TAlphaColor ; virtual;
- protected procedure SetClippingColor ( const AValue : TAlphaColor ) ; virtual;
- protected function GetNormalIntensity ( ) : Single ; virtual;
- protected procedure SetNormalIntensity ( const AValue : Single ) ; virtual;
- protected function GetInverseNormalMapping ( ) : Boolean ; virtual;
- protected procedure SetInverseNormalMapping ( const AValue : Boolean ) ; virtual;
- protected function GetParallaxLevels ( ) : Integer ; virtual;
- protected procedure SetParallaxLevels ( const AValue : Integer ) ; virtual;
- protected function GetMetallicBias ( ) : Single ; virtual;
- protected procedure SetMetallicBias ( const AValue : Single ) ; virtual;
- protected function GetRoughnessBias ( ) : Single ; virtual;
- protected procedure SetRoughnessBias ( const AValue : Single ) ; virtual;
- protected function GetAOBias ( ) : Single ; virtual;
- protected procedure SetAOBias ( const AValue : Single ) ; virtual;
- protected function GetUseLighting ( ) : Boolean ; virtual;
- protected procedure SetUseLighting ( const AValue : Boolean ) ; virtual;
- protected function GetUseSpecular ( ) : Boolean ; virtual;
- protected procedure SetUseSpecular ( const AValue : Boolean ) ; virtual;
- protected function GetUseTexturing ( ) : Boolean ; virtual;
- protected procedure SetUseTexturing ( const AValue : Boolean ) ; virtual;
- protected function GetUseTexture0 ( ) : Boolean ; virtual;
- protected procedure SetUseTexture0 ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRAlbedoTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRAlbedoTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRMetallicTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRMetallicTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRRoughnessTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRRoughnessTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRAOTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRAOTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBREmissiveTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBREmissiveTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUsePBRSpecularTexture ( ) : Boolean ; virtual;
- protected procedure SetUsePBRSpecularTexture ( const AValue : Boolean ) ; virtual;
- protected function GetUseVertexColor ( ) : Boolean ; virtual;
- protected procedure SetUseVertexColor ( const AValue : Boolean ) ; virtual;
- protected function GetUseColorClipping ( ) : Boolean ; virtual;
- protected procedure SetUseColorClipping ( const AValue : Boolean ) ; virtual;
- protected function GetAlphaCutoff ( ) : Single ; virtual;
- protected procedure SetAlphaCutoff ( const AValue : Single ) ; virtual;
- protected function GetUseAlphaCutoff ( ) : Boolean ; virtual;
- protected procedure SetUseAlphaCutoff ( const AValue : Boolean ) ; virtual;
- protected function GetNearLimit ( ) : Single ; virtual;
- protected procedure SetNearLimit ( const AValue : Single ) ; virtual;
- protected function GetFarLimit ( ) : Single ; virtual;
- protected procedure SetFarLimit ( const AValue : Single ) ; virtual;
- protected function GetTextureTiling ( AIndex : Integer ) : TPointF ; virtual;
- protected procedure SetTextureTiling ( AIndex : Integer; const AValue : TPointF ) ; virtual;
- protected function GetTexture0 ( ) : TBitmap ; virtual;
- protected procedure SetTexture0 ( const AValue : TBitmap ) ; virtual;
- protected function GetNormalMap ( ) : TBitmap ; virtual;
- protected procedure SetNormalMap ( const AValue : TBitmap ) ; virtual;
- protected function GetDisplacementMap ( ) : TBitmap ; virtual;
- protected procedure SetDisplacementMap ( const AValue : TBitmap ) ; virtual;
- protected function GetDisplacement ( ) : TVector3D ; virtual;
- protected procedure SetDisplacement ( const AValue : TVector3D ) ; virtual;
- protected function GetShadingModel ( ) : TGorillaShadingModel ; virtual;
- protected procedure SetShadingModel ( const AValue : TGorillaShadingModel ) ; virtual;
- protected function GetShadingIntensity ( ) : Single ; virtual;
- protected procedure SetShadingIntensity ( const AValue : Single ) ; virtual;
- protected function GetBrightness ( ) : Single ; virtual;
- protected procedure SetBrightness ( const AValue : Single ) ; virtual;
- protected function GetDepthPass ( ) : TGorillaRenderPassController ; virtual;
- protected procedure SetDepthPass ( const AValue : TGorillaRenderPassController ) ; virtual;
- protected function GetReflectionPower ( ) : Single ; virtual;
- protected procedure SetReflectionPower ( const AValue : Single ) ; virtual;
- protected function GetRefractionPower ( ) : Single ; virtual;
- protected procedure SetRefractionPower ( const AValue : Single ) ; virtual;
- protected function GetReflectionPass ( ) : TGorillaRenderPassController ; virtual;
- protected procedure SetReflectionPass ( const AValue : TGorillaRenderPassController ) ; virtual;
- protected function GetRefractionPass ( ) : TGorillaRenderPassController ; virtual;
- protected procedure SetRefractionPass ( const AValue : TGorillaRenderPassController ) ; virtual;
- protected function GetEnvironmentPass ( ) : TGorillaRenderPassController ; virtual;
- protected procedure SetEnvironmentPass ( const AValue : TGorillaRenderPassController ) ; virtual;
- protected function GetShadows ( ) : Boolean ; virtual;
- protected procedure SetShadows ( const AValue : Boolean ) ; virtual;
- protected function GetShadowMethod ( ) : TGorillaShadowMethod ;
- protected procedure SetShadowMethod ( const AValue : TGorillaShadowMethod ) ; virtual;
- protected function GetReflections ( ) : Boolean ; virtual;
- protected procedure SetReflections ( const AValue : Boolean ) ; virtual;
- protected function GetRefractions ( ) : Boolean ; virtual;
- protected procedure SetRefractions ( const AValue : Boolean ) ; virtual;
- protected function GetEnvironment ( ) : Boolean ; virtual;
- protected procedure SetEnvironment ( const AValue : Boolean ) ; virtual;
- protected function GetShadowMapPass ( AIndex : Integer ) : TGorillaRenderPassController ; virtual;
- protected procedure SetShadowMapPass ( AIndex : Integer; AValue : TGorillaRenderPassController ) ; virtual;
- protected function GetVertexShader ( ) : TStrings ; virtual;
- protected procedure SetVertexShader ( const AValue : TStrings ) ; virtual;
- protected function GetSurfaceShader ( ) : TStrings ; virtual;
- protected procedure SetSurfaceShader ( const AValue : TStrings ) ; virtual;
- protected procedure SetBitmaps ( const AValue : TGorillaBitmapPool ) ; virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- protected procedure Loaded
(
)
;
override;
Setup some basic settings after the material source was loaded from fmx-file.
- protected function CreateMaterial
(
)
: TMaterial
;
override;
Create the default material instance and apply material source settings.
- protected procedure ContextResetHandlerOverride
(
const
Sender :
TObject; const
Msg :
TMessageBase
)
;
virtual;
Callback method when the context handle was resetted.
- protected procedure DoCreateBitmapPool
(
)
;
virtual;
Creates the bitmap pool instance and executes previously the DoCheckDefaultBitmapFlags() routine.
- protected procedure DoCreateDefaultBitmaps
(
)
;
virtual;
Creates all default texture bitmaps depending on the specific flags, f.e. FAllowTexture0, FAllowNormalMapTexture, ...
- protected procedure DoUpdateDefaultBitmaps ( ) ; virtual;
- protected function DoAddOrUpdateBitmapToPool
(
const
AName :
string; const
AComps :
TPixelFormatEx; const
AFormat :
TPixelFormatEx; const
ADataType :
TGorillaTextureDataType; const
AIsDynamic :
Boolean; const
AIgnoreInArray :
Boolean; const
AProtectSettings :
Boolean; const
AShaderKind :
TContextShaderKind
=
PixelShader
; const
ATextureKind :
TGorillaTextureKind
=
Texture2D
)
: TGorillaBitmapPoolEntry
;
virtual;
Adds a new bitmap or updates an existing entry in bitmap texture pool.
- protected procedure DoDeleteBitmapInPool ( const AName : string ) ;
- protected procedure DoOnBitmapPoolChanged
(
ASender :
TObject
)
;
virtual;
Callback function when texture bitmap pool image data was changed.
- protected procedure DefineProperties ( Filer : TFiler ) ; override;
- public function FindBitmapByName
(
const
AName :
string
)
: TBitmap
;
Tries to find a pool bitmap by a supplied name. If no entry could be found, the method returns nil.
- public function FindBitmapEntryByName
(
const
AName :
string
)
: TGorillaBitmapPoolEntry
;
Tries to find a pool bitmap entry by a supplied name. If no entry could be found, the method returns nil.
- public procedure UpdateDefaultBitmaps
(
)
;
Updates the internal default texture bitmaps like Texture0, NormalMapTexture, ... Call this method, if you change the defines for internal textures to create/destroy a texture bitmap.
Properties
- public DiffuseF : TAlphaColorF
- public EmissiveF : TAlphaColorF
- public AmbientF : TAlphaColorF
- public SpecularF : TAlphaColorF
- public ClippingColorF : TAlphaColorF
Set the clipping color value: R/G/B is the basis color, A is the tolerance.
read GetClippingColorF
write SetClippingColorF - public TextureTiling[Index] : TPointF
- public UseLighting : Boolean
Enable or disable lighting shading model computation in shader.
read GetUseLighting
write SetUseLighting - public UseSpecular : Boolean
Enable or disable specular lighting for shading model computation in shader.
read GetUseSpecular
write SetUseSpecular - public UseTexturing : Boolean
Enable or disable general texturing functionality. Texture0 not necessary!
read GetUseTexturing
write SetUseTexturing - public UseTexture0 : Boolean
Enable or disable base color texturing or use color rendering.
read GetUseTexture0
write SetUseTexture0 - public UsePBRAlbedoTexture : Boolean
Enable or disable albedo texture usage. If this property is set to FALSE, the shader uses the diffuse color as albedo color.
read GetUsePBRAlbedoTexture
write SetUsePBRAlbedoTexture - public UsePBRMetallicTexture : Boolean
Enable or disable PBR (physically based rendering) albedo texture usage. If property is FALSE, the shader uses the PBRMetallicBias value.
read GetUsePBRMetallicTexture
write SetUsePBRMetallicTexture - public UsePBRRoughnessTexture : Boolean
Enable or disable PBR (physically based rendering) albedo texture usage. If property is FALSE, the shader uses the PBRRoughnessBias value.
read GetUsePBRRoughnessTexture
write SetUsePBRRoughnessTexture - public UsePBRAOTexture : Boolean
Enable or disable PBR (physically based rendering) ambient occlusion texture usage. If property is FALSE, the shader uses the PBRAOBias value.
read GetUsePBRAOTexture
write SetUsePBRAOTexture - public UsePBREmissiveTexture : Boolean
Enable or disable PBR (physically based rendering) emissive texture usage. If property is FALSE, the shader uses the material emissive color value only.
read GetUsePBREmissiveTexture
write SetUsePBREmissiveTexture - public UsePBRSpecularTexture : Boolean
Enable or disable PBR (physically based rendering) specular texture usage. If property is FALSE, the shader uses the material specular color value only.
read GetUsePBRSpecularTexture
write SetUsePBRSpecularTexture - public UseVertexColor : Boolean
- public UseColorClipping : Boolean
- public AlphaCutoff : Single
Get or set alpha cutoff value. If UseAlphaCutoff is enabled, fragments are clipped depending on the alpha channel value.
read GetAlphaCutoff
write SetAlphaCutoff - public UseAlphaCutoff : Boolean
- public Texture : TBitmap
Get or set the diffuse color texture. This is only a weak reference to the first entry in the texture pool (Bitmaps).
read GetTexture0
write SetTexture0 - public Inputs : TDictionary<System.string,Gorilla.Controller.TGorillaRenderPassController>
- public ShadowMapPass[Index] : TGorillaRenderPassController
- published ShadingModel : TGorillaShadingModel
Get or set the used shading model. You can choose between Lambert, Phong or Blinnphong shading algorithm.
read GetShadingModel
write SetShadingModel - published ShadingIntensity : Single
Get or set the shading intensity value for applied to diffuse and specular color channel.
read GetShadingIntensity
write SetShadingIntensity - published Brightness : Single
Get or set the brightness intensity value getting applied to diffuse color.
read GetBrightness
write SetBrightness - published MeasureTime : Boolean
Activate or deactivate time measurement in shader. Only if activated TimeInfo values will be updated during rendering.
read GetMeasureTime
write SetMeasureTime - published Color : TAlphaColor
For better FMX > Gorilla3D migration support we provide a "Color" property for TColorMaterialSource's. It's equivalent to "Diffuse", so we just need a virtual property.
read GetDiffuse
write SetDiffuse - published Diffuse : TAlphaColor
- published Emissive : TAlphaColor
- published Ambient : TAlphaColor
- published Specular : TAlphaColor
- published Shininess : Single
- published ClippingColor : TAlphaColor
Set the clipping color value: R/G/B is the basis color, A is the tolerance.
read GetClippingColor
write SetClippingColor - published NormalIntensity : Single
Get or set normal mapping / parallax occulusion mapping intensity.
read GetNormalIntensity
write SetNormalIntensity - published InverseNormalMapping : Boolean
Enable/Disable inverse direction of normal mapping / parallax occlusion mapping. Valid values are 1 or -1.
read GetInverseNormalMapping
write SetInverseNormalMapping - published ParallaxLevels : Integer
Get or set the number of levels for parallax occlusion mapping computation. Values between 4 and 256 are allowed.
read GetParallaxLevels
write SetParallaxLevels - published MetallicBias : Single
Get or set bias value for controlling metallic effect in physically based rendering.
read GetMetallicBias
write SetMetallicBias - published RoughnessBias : Single
Get or set bias value for controlling roughness/noise effect in physically based rendering.
read GetRoughnessBias
write SetRoughnessBias - published AOBias : Single
- published NearLimit : Single
- published FarLimit : Single
- published Shadows : Boolean
- published ShadowMethod : TGorillaShadowMethod
Get or set the used shadow method in shader. This property only has effect if "Shadows" is set to true.
read GetShadowMethod
write SetShadowMethod - published MainShadowMapPass : TGorillaRenderPassController
Get or set the first of eight possible shadow mapping passes. This is very useful at design-time for a fast scene setup.
read GetShadowMapPass
write SetShadowMapPass - published DepthPass : TGorillaRenderPassController
- published Reflections : Boolean
- published ReflectionPass : TGorillaRenderPassController
Get reflection render pass or set reflection render pass to apply a reflection texture to material.
read GetReflectionPass
write SetReflectionPass - published ReflectionPower : Single
Read or write reflection color mixing factor from / to material.
read GetReflectionPower
write SetReflectionPower - published Refractions : Boolean
- published RefractionPass : TGorillaRenderPassController
Get refraction render pass or set refraction render pass to apply a refraction texture to material.
read GetRefractionPass
write SetRefractionPass - published RefractionPower : Single
Read or write refraction color mixing factor from / to material.
read GetRefractionPower
write SetRefractionPower - published Environment : Boolean
- published EnvironmentPass : TGorillaRenderPassController
Get environment render pass or set environment render pass to apply a environment cubemap texture to material.
read GetEnvironmentPass
write SetEnvironmentPass - published VertexShader : TStrings
Get or set the vertex shader code. This will overwrite the internal VertexShader() function in our default GPU shader. You have to keep the function name and the minimum parameters!
read GetVertexShader
write SetVertexShader - published SurfaceShader : TStrings
Get or set the surface shader code. This will overwrite the internal SurfaceShader() function in our default GPU shader. You have to keep the function name and the minimum parameters!
read GetSurfaceShader
write SetSurfaceShader - published Bitmaps : TGorillaBitmapPool
Get the texture bitmap pool, where all textures are stored in for more easy handling by the shader.
read FBitmaps
write SetBitmaps