Skip to content

TextStudio3DShaderRegistry

ClassTextStudio.ThreeDTextStudio.3D
public static class TextStudio3DShaderRegistry

Owns shader-reference/material-mode registrations on the main thread. Register customer declarations before rendering and dispose their leases with the owner. Resources/TextStudio3D/ShaderContracts assets are loaded automatically. Declarations are validated against the selected SubShader; this does not qualify native visuals.

Register(Shader, TextStudio3DShaderContract)

Section titled “Register(Shader, TextStudio3DShaderContract)”
public static IDisposable Register(Shader shader, TextStudio3DShaderContract contract)

Identical declarations share a lease; conflicts throw without replacing an existing registration.

Parameters

Name Type
shader UnityEngine.Shader
contract TextStudio.ThreeD.TextStudio3DShaderContract

Returns

System.IDisposable

TryGet(Material, out TextStudio3DShaderContract, out TextStudio3DShaderPipelineContract, out string)

Section titled “TryGet(Material, out TextStudio3DShaderContract, out TextStudio3DShaderPipelineContract, out string)”
public static bool TryGet(Material material, out TextStudio3DShaderContract contract, out TextStudio3DShaderPipelineContract pipeline, out string diagnostic)

Returns only a declaration structurally valid for this material's active pipeline.

Parameters

Name Type
material UnityEngine.Material
contract TextStudio.ThreeD.TextStudio3DShaderContract
pipeline TextStudio.ThreeD.TextStudio3DShaderPipelineContract
diagnostic System.String

Returns

System.Boolean

ValidateMaterial(Material, TextStudio3DShaderContract)

Section titled “ValidateMaterial(Material, TextStudio3DShaderContract)”
public static string ValidateMaterial(Material material, TextStudio3DShaderContract contract)

Checks current pass/keyword declarations. Does not execute shader programs or infer rendered coverage.

Parameters

Name Type
material UnityEngine.Material
contract TextStudio.ThreeD.TextStudio3DShaderContract

Returns

System.String

public static void InvalidateValidationCaches()

Invalidate after changing/importing shaders. Existing leases stay owned; decisions and uploaded-layout keys change.

public static void RefreshResourceContracts()

Reload resource declarations after authoring changes, preserving independently owned registrations.

public static ulong GetMaterialFingerprint(Material material)

Returns the registered contract fingerprint for the material's selected mode, or zero when no valid declaration applies.

Parameters

Name Type
material UnityEngine.Material

Returns

System.UInt64

public static uint Revision { get; }

Returns

System.UInt32