Table of Contents

Class GizmoEmissiveColorMaterial

Namespace
Stride.CommunityToolkit.Rendering.Gizmos
Assembly
Stride.CommunityToolkit.dll

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

device GraphicsDevice

The GraphicsDevice used to create the material.

color Color

The Color to apply to the material.

intensity float

The intensity of the emissive color. Defaults to 1f.

Returns

Material

A new Material with the specified emissive color and intensity.

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.