Record TLightInstance
Unit
Declaration
type TLightInstance = record
Description
Light source instance in the scene. References VRML/X3D light source node (see Node), and keeps track of light source transformation in the 3D world. For the sake of speed also stores a couple of light's properties already multiplied by the transformation.
This record may be initialized only by TAbstractLightNode.CreateLightInstance. Update it (when transform changes) by TAbstractLightNode.UpdateLightInstance.
Overview
Fields
Node: TAbstractLightNode; |
|
Transform: TMatrix4; |
|
TransformScale: Single; |
|
Location: TVector3; |
|
Direction: TVector3; |
|
Radius: Single; |
|
WorldCoordinates: boolean; |
Methods
function Position: TVector4; |
|
function Contribution( const Point: TVector3; const PointPlaneNormal: TVector3; State: TX3DGraphTraverseState; const CamPosition: TVector3; const MainTextureColor: TCastleColorRGB): TVector3; |
Description
Fields
Node: TAbstractLightNode; |
|
This item has no description. |
Transform: TMatrix4; |
|
This item has no description. |
TransformScale: Single; |
|
This item has no description. |
Location: TVector3; |
|
Light location, already transformed by the Transform matrix. For TAbstractPositionalLightNode lights. |
Direction: TVector3; |
|
Light direction, already normalized and transformed by the Transform matrix. For spot and directional lights. |
Radius: Single; |
|
Light radius, already transformed by the Transform matrix. For lights with radius (positional lights in VRML >= 2.0, that is TAbstractPositionalLightNode with HasRadius = true). |
WorldCoordinates: boolean; |
|
Are light location, direction (in this class and inside Node fields) expressed in world coordinates. If not, they are expressed in scene coordinates. This matters if you render the scene using TCastleScene, and transform it (by wrapping it in TCastleTransform, or by directly changing TCastleScene transformation properties inherited from TCastleTransform). By default ( |
Methods
function Position: TVector4; |
|
Position expressed in homogeneous coordinates. For positional lights, the last component is always 1. For directional lights, the last component is always 0. |
function Contribution( const Point: TVector3; const PointPlaneNormal: TVector3; State: TX3DGraphTraverseState; const CamPosition: TVector3; const MainTextureColor: TCastleColorRGB): TVector3; |
|
Light contribution to the specified vertex color. This can be used by software renderers (ray-tracers etc.) to calculate pixel color following VRML/X3D specifications. TX3DGraphTraverseState.Emission should be added to We do not clamp color components to (0, 1). This would be a waste of time, you should clamp only at the end (or never). This also allows to multiply / accumulate values outside of the (0, 1) range during calculations. OpenGL also clamps only at the end. MainTextureColor is color of the "main" texture. See TAppearanceNode.MainTexture for definition what is this texture. |
Generated by PasDoc 0.16.0-snapshot.