Class ScyllaShaderInclusionBuildProcessor
Build preprocessor that keeps every Scylla shader loaded at runtime via Find(string) from being stripped out of players.
Implements
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public sealed class ScyllaShaderInclusionBuildProcessor : IPreprocessBuildWithReport, IOrderedCallback
Remarks
Before each build, this collects the shader-name prefixes and exact shader names declared by
every IScyllaShaderProvider in the loaded editor assemblies, finds the project
shaders that match, and adds any that are missing to the project's Always Included Shaders
list (Project Settings > Graphics). Prefixes cover Scylla-authored shaders; exact
names cover non-Scylla shaders a module resolves by name, such as the active render
pipeline's default lit shader. Without this, shaders that only ever get resolved by name at
runtime have no material asset referencing them, so Unity's build stripping removes them and
the affected renderers turn pink.
The pass is additive and idempotent: it never removes an entry, skips shaders already present, and does nothing when no module contributes a prefix. Any failure is logged as a warning and does not abort the build; the shaders can still be added manually.
Properties
callbackOrder
The relative order in which this build callback runs. Zero places it with the default preprocessors; the value is not sensitive because the pass only edits project settings.
Declaration
public int callbackOrder { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
OnPreprocessBuild(BuildReport)
Ensures every Scylla shader declared by an IScyllaShaderProvider is present in the Always Included Shaders list before the build proceeds.
Declaration
public void OnPreprocessBuild(BuildReport report)
Parameters
| Type | Name | Description |
|---|---|---|
| BuildReport | report | The build report supplied by Unity. Unused; the pass is build-agnostic. |