Click or drag to resize
AB4D logo

DirectionalLightShader Class

DirectionalLightShader class is used by the StandardEffect and is optimized to render up to 3 directional lights.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectX.ShadersDirectionalLightShader

Namespace: Ab3d.DirectX.Shaders
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class DirectionalLightShader : SharedDXDeviceResource, 
	IStandardShader

The DirectionalLightShader type exposes the following members.

Constructors
 NameDescription
Public methodDirectionalLightShaderInitializes a new instance of the DirectionalLightShader class
Top
Methods
 NameDescription
Public methodApplyMaterial Sets the content of the constant buffers based on the specified Material and other properties.
Public methodApplyPerFrameSettings Sets per frame settings for this effect (this sets camera, lights and other per frame settings).
Public methodPreloadShaders Loads all the shaders
Public methodResetRenderableGeometryMaterialFlagsValue When RenderableGeometry objects are rendered in the same order in each frame, the RenderableGeometry.MaterialFlags value specifies how similar the material is to the previous object (for example if diffuse part is the same, then many color checks can be skipped). But when the order of rendering is changed or if we start rendering from the middle of the RenderingQueue, then we need to reset the cached value for the first rendered RenderableGeometry so that all the checks are done agine. This method does that.
Public methodSetCustomPerFrameConstantBuffers SetCustomPerFrameConstantBuffers sets custom perFrameCameraConstantsBuffer and perFrameLightsConstantBuffer. Note that the constant buffers need to be exactly the same as the DirectionalLightShader expects.
Top
See Also