Class TMaterialNode

Unit

Declaration

type TMaterialNode = class(TAbstractMaterialNode)

Description

Surface material properties for associated geometry nodes, used by the lighting equations during rendering.

Hierarchy

Overview

Methods

Public procedure CreateNode; override;
Public destructor Destroy; override;
Public class function ClassX3DType: string; override;
Public class function URNMatching(const URN: string): boolean; override;
Public class function ForVRMLVersion(const Version: TX3DVersion): boolean; override;
Public function Opacity: Single;
Public function ShininessExp: Single;
Public function MaterialInfo: TMaterialInfo;
Public function PureEmissive: boolean;
Public procedure ForcePureEmissive;
Public procedure SetReflSpecular(const Value: array of TCastleColorRGB);
Public procedure SetReflSpecular(const Value: TVector3List);
Public procedure SetReflDiffuse(const Value: array of TCastleColorRGB);
Public procedure SetReflDiffuse(const Value: TVector3List);
Public procedure SetTransSpecular(const Value: array of TCastleColorRGB);
Public procedure SetTransSpecular(const Value: TVector3List);
Public procedure SetTransDiffuse(const Value: array of TCastleColorRGB);
Public procedure SetTransDiffuse(const Value: TVector3List);

Properties

Public property FdAmbientIntensity: TSFFloat read FFdAmbientIntensity;
Public property FdDiffuseColor: TSFColor read FFdDiffuseColor;
Public property FdEmissiveColor: TSFColor read FFdEmissiveColor;
Public property FdShininess: TSFFloat read FFdShininess;
Public property FdSpecularColor: TSFColor read FFdSpecularColor;
Public property FdTransparency: TSFFloat read FFdTransparency;
Public property FdFogImmune: TSFBool read FFdFogImmune;
Public property FdMirror: TSFFloat read FFdMirror;
Public property FdReflSpecular: TMFColor read FFdReflSpecular;
Public property FdReflDiffuse: TMFColor read FFdReflDiffuse;
Public property FdTransSpecular: TMFColor read FFdTransSpecular;
Public property FdTransDiffuse: TMFColor read FFdTransDiffuse;
Public property FdReflSpecularExp: TSFFloat read FFdReflSpecularExp;
Public property FdTransSpecularExp: TSFFloat read FFdTransSpecularExp;
Public property AmbientIntensity: Single read GetAmbientIntensity write SetAmbientIntensity;
Public property DiffuseColor: TCastleColorRGB read GetDiffuseColor write SetDiffuseColor;
Public property EmissiveColor: TCastleColorRGB read GetEmissiveColor write SetEmissiveColor;
Public property Shininess: Single read GetShininess write SetShininess;
Public property SpecularColor: TCastleColorRGB read GetSpecularColor write SetSpecularColor;
Public property Transparency: Single read GetTransparency write SetTransparency;
Public property Mirror: Single read GetMirror write SetMirror;
Public property ReflSpecularExp: Single read GetReflSpecularExp write SetReflSpecularExp;
Public property TransSpecularExp: Single read GetTransSpecularExp write SetTransSpecularExp;

Description

Methods

Public procedure CreateNode; override;
 
Public destructor Destroy; override;
 
Public class function ClassX3DType: string; override;
 
Public class function URNMatching(const URN: string): boolean; override;
 
Public class function ForVRMLVersion(const Version: TX3DVersion): boolean; override;
 
Public function Opacity: Single;

Opacity is just a 1 - FdTransparency.Value. Defined for your comfort — for OpenGL you will usually want to pass Opacity, not Transparency.

Public function ShininessExp: Single;

ShininessExp is just 128 * FdShininess.Value, this is the "real" exponent indicated by shininess field value. Defined for your comfort — for any graphic library you will usually want to pass the "real" exponent given by this function, not just value of shininess field.

Public function MaterialInfo: TMaterialInfo;

Material information based on this node. It is automatically updated when properties of this material change. Do not free it yourself, it will be automatically freed when this node is freed.

Public function PureEmissive: boolean;

Only the emissiveColor is not black (zero), which means that the material behaves like unlit.

This checks that ambient and diffuse and specular colors are all zero. It's an important information about the material sometimes. It is similar to the NULL material situation (when "Appearance.material=NULL" case), but the color and transparency are still configurable (using FdEmissiveColor and FdTransparency fields).

We can optimize this case when rendering.

Public procedure ForcePureEmissive;

Force the material pure emissive (see PureEmissive) by setting other colors to black.

Public procedure SetReflSpecular(const Value: array of TCastleColorRGB);
 
Public procedure SetReflSpecular(const Value: TVector3List);
 
Public procedure SetReflDiffuse(const Value: array of TCastleColorRGB);
 
Public procedure SetReflDiffuse(const Value: TVector3List);
 
Public procedure SetTransSpecular(const Value: array of TCastleColorRGB);
 
Public procedure SetTransSpecular(const Value: TVector3List);
 
Public procedure SetTransDiffuse(const Value: array of TCastleColorRGB);
 
Public procedure SetTransDiffuse(const Value: TVector3List);
 

Properties

Public property FdAmbientIntensity: TSFFloat read FFdAmbientIntensity;
 
Public property FdDiffuseColor: TSFColor read FFdDiffuseColor;
 
Public property FdEmissiveColor: TSFColor read FFdEmissiveColor;
 
Public property FdShininess: TSFFloat read FFdShininess;
 
Public property FdSpecularColor: TSFColor read FFdSpecularColor;
 
Public property FdTransparency: TSFFloat read FFdTransparency;
 
Public property FdFogImmune: TSFBool read FFdFogImmune;

Make the object not affected by fog. This is a Castle Game Engine extension, not present in X3D standard.

Public property FdMirror: TSFFloat read FFdMirror;

Make the object a mirror. Right now used only by the classic ray-tracer, not by interactive renderer. This is a Castle Game Engine extension, not present in X3D standard.

Public property FdReflSpecular: TMFColor read FFdReflSpecular;
 
Public property FdReflDiffuse: TMFColor read FFdReflDiffuse;
 
Public property FdTransSpecular: TMFColor read FFdTransSpecular;
 
Public property FdTransDiffuse: TMFColor read FFdTransDiffuse;
 
Public property FdReflSpecularExp: TSFFloat read FFdReflSpecularExp;
 
Public property FdTransSpecularExp: TSFFloat read FFdTransSpecularExp;
 
Public property AmbientIntensity: Single read GetAmbientIntensity write SetAmbientIntensity;
 
Public property DiffuseColor: TCastleColorRGB read GetDiffuseColor write SetDiffuseColor;
 
Public property EmissiveColor: TCastleColorRGB read GetEmissiveColor write SetEmissiveColor;
 
Public property Shininess: Single read GetShininess write SetShininess;
 
Public property SpecularColor: TCastleColorRGB read GetSpecularColor write SetSpecularColor;
 
Public property Transparency: Single read GetTransparency write SetTransparency;
 
Public property Mirror: Single read GetMirror write SetMirror;
 
Public property ReflSpecularExp: Single read GetReflSpecularExp write SetReflSpecularExp;
 
Public property TransSpecularExp: Single read GetTransSpecularExp write SetTransSpecularExp;
 

Generated by PasDoc 0.15.0.