Class TextModeMaterials
Manages shader loading and material creation for the TextMode rendering pipeline. Caches materials to prevent redundant allocations.
Build Note: Shaders are loaded via Shader.Find. Because no material asset
references them, Unity's build stripping would drop them (turning cells pink in players).
The Scylla editor build preprocessor handles this automatically: it adds every
Scylla/TextMode/ shader to the Always Included Shaders list before each
build (see the module's shader provider and the Core build processor). No manual step is
required; adding them yourself under Edit > Project Settings > Graphics still
works as a fallback.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public static class TextModeMaterials
Methods
ClearCache()
Clears cached shader references. Call when the module shuts down.
Declaration
public static void ClearCache()
CreateCellMaterial(Texture2D)
Creates a new material instance for cell rendering.
Declaration
public static Material CreateCellMaterial(Texture2D atlasTexture)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | atlasTexture | The SDF font atlas texture to assign. |
Returns
| Type | Description |
|---|---|
| Material | A new material configured for cell rendering, or null if the shader is not found. |
CreateCellOffscreenMaterial()
Creates a new material instance for rendering a grid into a render texture.
Declaration
public static Material CreateCellOffscreenMaterial()
Returns
| Type | Description |
|---|---|
| Material | A new material configured for offscreen cell rendering, or null if the shader is not found. |
Remarks
The material carries no atlas, because the atlas belongs to the view being captured. TextModeGridCapture supplies it per draw through a property block.
CreateUICellMaterial(Texture2D)
Creates a new material instance for UI cell rendering.
Declaration
public static Material CreateUICellMaterial(Texture2D atlasTexture)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | atlasTexture | The SDF font atlas texture to assign. |
Returns
| Type | Description |
|---|---|
| Material | A new material configured for UI cell rendering, or null if the shader is not found. |
GetCellOffscreenShader()
Gets the offscreen cell shader, loading it if necessary.
Declaration
public static Shader GetCellOffscreenShader()
Returns
| Type | Description |
|---|---|
| Shader | The offscreen cell shader, or null if not found. |
GetCellShader()
Gets the cell renderer shader, loading it if necessary.
Declaration
public static Shader GetCellShader()
Returns
| Type | Description |
|---|---|
| Shader | The cell renderer shader, or null if not found. |
GetUICellShader()
Gets the UI cell renderer shader, loading it if necessary.
Declaration
public static Shader GetUICellShader()
Returns
| Type | Description |
|---|---|
| Shader | The UI cell renderer shader, or null if not found. |