public class StandardEffect : Effect, IMultiPassEffect
Thetype exposes the following members.
Gets the input layout that is required to render this effect.(Overrides EffectRequiredInputLayoutType.)
Applies the material and object's world matrix to this effect.(Overrides EffectApplyMaterial(Material, RenderablePrimitiveBase).)
Sets the constant buffers and prepares all the shader states for rendering the specfied rendering pass. Before this method is called the OnApplyPerFrameSettings method must be called to set other frame settings.
Returns and instance of DirectionalLightShader that is used by this StandardEffect. The method increases reference count on DirectionalLightShader. This means that the returned instance must be disposed when it is not used any more.
Gets number of passes required to render this effect.
Returns and instance of SuperShader that is used by this StandardEffect. The method increases reference count on SuperShader. This means that the returned instance must be disposed when it is not used any more.
Returns true when per pixel shader should be used for specified shader quality.
IsUsingSuperShader method return true if SuperShader is needed to render the specified lights. When false is returned than DirectionalLightShader can render the scene. This method also creates the needed shader (SuperShader or DirectionalLightShader) if is was not yet created.
PreloadShaders can be called to load the shaders in advance before they are used. Calling this method increases the startup time, but when the 3D object needs to be shown, it is shown faster because all the shaders have already been created.(Overrides EffectPreloadShaders.)
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 again. This method does that.
SetCustomPerFrameConstantBuffers sets custom perFrameCameraConstantsBuffer and perFrameLightsConstantBuffer. Note that the constant buffers need to be exactly the same as the DirectionalLightShader or SuperShader expects.