Skip to content

Keyword Declaration Override does not apply to Shader Graph keywords defined when building #52

Description

@RuyeRuye

Describe the bug

When using Unity 6000.3 Keyword Declaration Override feature (under Project Settings > Graphics > Shader Build Settings) to override Shader Graph keywords (e.g., setting them to dynamic_branch) for glTFast's glTF-pbrMetallicRoughness shader, the override does not take effect in the final build unless the Allow Definition Override option is manually enabled on the corresponding keyword inside the Shader Graph or its SubGraph.

After enabling Allow Definition Override on the keyword, rebuilding resolves the issue and materials render correctly.

Additionally, the actual keyword name required in Keyword Declaration Override does not match the Reference name shown in Shader Graph's Blackboard. In my case, the Blackboard shows _EMISSIVE but the generated shader code uses _ _EMISSIVE. This point might require additional clarification.

Files

N/A – This issue is reproducible with the glTFast package's built-in Shader Graph shaders and does not require an external glTF file. No glTF files are attached.

To Reproduce
Steps to reproduce the behavior:

  1. In Project Settings > Graphics > Shader Build Settings, add a Keyword Declaration Override for a glTFast Shader Graph keyword (e.g._ _EMISSIVE) and set Type Override to dynamic_branch.
  2. Build the project (Windows Player or Standalone).
  3. Load any glTF/glb file at runtime that uses the _EMISSIVE keyword.
  4. Observe that the material renders pink / magenta (shader variant missing).
  5. Re-open the project and locate the glTFast Shader Graph asset (glTF-pbrMetallicRoughness) and its corresponding SubGraph(s).
  6. Find the _EMISSIVE keyword in the Blackboard, select it, and enable Allow Definition Override.
  7. Rebuild the project.
  8. Load the same glTF file again.
  9. Observe that the material now renders correctly.

Expected behavior

The Keyword Declaration Override set in Project Settings should take effect without requiring manual intervention inside the Shader Graph / SubGraph assets.

Screenshots

Image

Desktop (please complete the following information):

  • glTFast version: 6.19.0
  • Unity Editor version: 6000.3.17f1
  • Render Pipeline: Universal Render Pipeline (URP) 17.3.0
  • Platform: Editor / Windows Player (Standalone)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions