Class MeshFallbackEffects
Builds the effect a MeshRenderFeature draws with while a mesh's real effect is still compiling or failed to compile. It keeps the mesh's diffuse texture or color with Lambert shading and its skinning, and drops every other material feature, so all meshes share a few permutations that are usually already compiled and never depend on user shaders.
public class MeshFallbackEffects
- Inheritance
-
objectMeshFallbackEffects
- Extension Methods
Constructors
MeshFallbackEffects(GraphicsDevice, EffectSystem)
public MeshFallbackEffects(GraphicsDevice graphicsDevice, EffectSystem effectSystem)
Parameters
graphicsDeviceGraphicsDeviceeffectSystemEffectSystem
Methods
ComputeFallbackEffect(RenderObject, RenderEffect, RenderEffectState)
Loads the fallback effect for renderEffect. Matches RootEffectRenderFeature.ComputeFallbackEffectDelegate.
public Effect ComputeFallbackEffect(RenderObject renderObject, RenderEffect renderEffect, RenderEffectState renderEffectState)
Parameters
renderObjectRenderObjectrenderEffectRenderEffectrenderEffectStateRenderEffectState
Returns
- Effect
The fallback effect, or
nullwhen it could not be loaded, in which case the render effect is flagged as errored.
ComputeFallbackEffect(RenderObject, RenderEffect, RenderEffectState, Action<RenderEffect, RenderEffectState, CompilerParameters>)
Same as ComputeFallbackEffect(RenderObject, RenderEffect, RenderEffectState), with a hook to adjust the compiler parameters before the effect is loaded.
public Effect ComputeFallbackEffect(RenderObject renderObject, RenderEffect renderEffect, RenderEffectState renderEffectState, Action<RenderEffect, RenderEffectState, CompilerParameters> customizeParameters)
Parameters
renderObjectRenderObjectrenderEffectRenderEffectrenderEffectStateRenderEffectStatecustomizeParametersAction<RenderEffect, RenderEffectState, CompilerParameters>
Returns
CreateCompilerParameters(RenderMesh)
Creates the compiler parameters of the fallback effect for renderMesh.
public CompilerParameters CreateCompilerParameters(RenderMesh renderMesh)
Parameters
renderMeshRenderMesh
Returns
- CompilerParameters