Class GizmoEmissiveColorMaterial
A utility class for creating and updating materials with emissive color properties for gizmos.
public static class GizmoEmissiveColorMaterial
- Inheritance
-
GizmoEmissiveColorMaterial
Methods
Create(GraphicsDevice, Color, float)
Creates a new material with emissive color and diffuse properties based on the specified color and intensity.
public static Material Create(GraphicsDevice device, Color color, float intensity = 1)
Parameters
deviceGraphicsDeviceThe GraphicsDevice used to create the material.
colorColorThe Color to apply to the material.
intensityfloatThe intensity of the emissive color. Defaults to 1f.
Returns
Remarks
A color with an alpha below 255 produces a translucent material: the descriptor gains a MaterialTransparencyBlendFeature, the emissive feature is told to take the material alpha from its own alpha channel, and the color values are premultiplied. All three are needed - Stride blends transparent materials with premultiplied alpha, and without the blend feature the alpha is simply ignored, so the mesh renders fully opaque or, for a low alpha, appears to vanish. Opaque colors stay in the opaque render stage.