TextStudio3DShaderRegistry
public static class TextStudio3DShaderRegistryOwns 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.
Methods
Section titled “Methods”
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
InvalidateValidationCaches()
Section titled “InvalidateValidationCaches()”public static void InvalidateValidationCaches()Invalidate after changing/importing shaders. Existing leases stay owned; decisions and uploaded-layout keys change.
RefreshResourceContracts()
Section titled “RefreshResourceContracts()”public static void RefreshResourceContracts()Reload resource declarations after authoring changes, preserving independently owned registrations.
GetMaterialFingerprint(Material)
Section titled “GetMaterialFingerprint(Material)”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
Properties
Section titled “Properties”
Revision
Section titled “Revision”public static uint Revision { get; }Returns
System.UInt32