Interface IScyllaShaderProvider
Implemented once per module to declare the shaders that module loads at runtime through Find(string), so the build keeps them resolvable.
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public interface IScyllaShaderProvider
Remarks
Scylla modules build their materials at runtime by looking a shader up by name and calling
new Material(shader). Because no material asset in a built scene references those
shaders, Unity's build-time shader stripping drops them (or their variants) and the
affected renderers turn pink in players. ScyllaShaderInclusionBuildProcessor
discovers every implementation of this interface via
UnityEditor.TypeCache at build time and adds the matching shaders to the
project's Always Included Shaders list so the lookups keep resolving.
Each module owns its own provider inside its editor assembly, so a module that is not imported contributes nothing (its editor assembly is simply absent). Declare Scylla-authored shaders with a prefix (GetShaderNamePrefixes()); declare non-Scylla shaders a module resolves by name, such as the active render pipeline's default lit shader, with an exact name (GetExactShaderNames()).
Methods
GetExactShaderNames()
Returns exact shader names (full Shader.name) this module resolves at runtime that a
Scylla prefix does not cover, typically shaders authored outside Scylla such as the active
render pipeline's default lit shader. Each is kept in the build if it exists in the project.
Declaration
IEnumerable<string> GetExactShaderNames()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | A sequence of exact shader names. May be empty; must not be |
Remarks
The default implementation returns an empty sequence; only modules that resolve non-Scylla shaders by name need override it. A name that matches no shader in the project (for example a pipeline that is not installed) is simply skipped, so it is safe to list every pipeline's default shader.
GetShaderNamePrefixes()
Returns the shader-name prefixes identifying this module's runtime-loaded shaders. Any
shader in the project whose Shader.name starts with one of these prefixes is kept
in the build.
Declaration
IEnumerable<string> GetShaderNamePrefixes()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | A sequence of shader-name prefixes (for example |