A3DGraphDirectionalLightData

struct A3DGraphDirectionalLightData

Data for a directional light source entity (A3DGraphDirectionalLight)

2.0

2.0

A directional light simulates a source which is far away from the scene. In that situation, all light rays are coming from the same direction, regardless of the position of the illuminated object or the viewer. The illumination only depends on the light orientation, and not its position.

All colors within this structure are global indexes to RGB color codes. The actual values can be queried using A3DGlobalGetGraphRgbColorData.

A3DGraphDirectionalLightData is one of the four light source types provided by HOOPS. It is associated to the kA3DTypeGraphDirectionalLight entity type. The other available light sources are A3DGraphAmbientLightData, A3DGraphPointLightData and A3DGraphSpotLightData.

A3D_MAKE_DATA initializes m_dIntensity to 0.0. For a full-strength light, set m_dIntensity to 1.0 before calling A3DGraphDirectionalLightCreate.

Only directional lights have an intensity value. A3DGraphAmbientLightData, A3DGraphPointLightData and A3DGraphSpotLightData have no equivalent field. For point and spot lights, the light colors set the strength and the attenuation factors reduce it with distance.

HOOPS does not check or clamp the value of m_dIntensity. A3DGraphDirectionalLightCreate stores any value, and some readers, such as the U3D reader, copy the value from the file without validation. It is up to your application to validate this value if needed.

A3DGraphDirectionalLightGet()

A3DGraphDirectionalLightCreate()

A3DGraphRgbColorData

A3DGlobalGetGraphRgbColorData()

A3DGlobalInsertGraphRgbColor()

A3DGraphMaterialData

A3DGraphAmbientLightData

A3DGraphPointLightData

A3DGraphSpotLightData

Directional light source data.

Variables

A3DUns32 A3DGraphDirectionalLightData.m_uiAmbientColorIndex

The main or ambient color of the light source.

A3DUns32 A3DGraphDirectionalLightData.m_uiDiffuseColorIndex

The diffuse color of the light source.

A3DUns32 A3DGraphDirectionalLightData.m_uiSpecularColorIndex

The specular color of the light source.

A3DDouble A3DGraphDirectionalLightData.m_dIntensity

The intensity coefficient of the light source, expected in [0.0 ; 1.0], where 1.0 is full intensity.

A3DVector3dData A3DGraphDirectionalLightData.m_sDirection

The direction of the light source, in world space coordinates.