Click or drag to resize
AB4D logo

SuperShader Class

SuperInstancedShader class is used by the StandardEffect and support many different lights (Directional, Point, Spot and Ambient light). The number of lights that can be rendered in single pass is defined by the MaxLights constant.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectX.ShadersSuperShader

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

The SuperShader type exposes the following members.

Constructors
 NameDescription
Public methodSuperShaderInitializes a new instance of the SuperShader class
Top
Properties
 NameDescription
Public propertyLastUsedFrameNumber Gets frame number in which this shader was used.
Public propertyShadowDepthBias Gets or sets a float value that offsets the depth of the lights (distance from the lights to the object) and can help reduce the show artifacts in the corners. The value that works best need to be set based on the size of the scene. Default value is 0 that does not apply any bias.
Public propertyShadowThreshold Gets or sets a float value that helps prevent light bleeding (having areas that should be in shadow fully illuminated) for variance shadow mapping.
Public propertyShadowTresholdObsolete.
Gets or sets a float value that helps prevent light bleeding (having areas that should be in shadow fully illuminated) for variance shadow mapping.
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 methodApplyRenderingPass Prepares the lights constant buffer for the specified rendering pass.
Public methodStatic memberGetRequiredRenderingPassesCount Returns number of rendering passes that are required to render the specified lights.
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 SuperShader expects.
Public methodSetShadowMappingParameters SetShadowMappingParameters sets parameters needed for shadow mapping. This method must be called before the ApplyPerFrameSettings(ICamera, IListILight, RenderingContext) method. Shadow rendering is enabled only after the next call to ApplyPerFrameSettings and before another ApplyPerFrameSettings call.
Top
Fields
 NameDescription
Public fieldStatic memberMaxLights Maximum number of lights that can be rendered by this SuperShader (Ambient light is not counted).
Public fieldStatic memberMaxShadowLights Gets the maximum number of lights that can cast shadow.
Top
See Also