Search Issue Tracker
By Design
By Design in 6000.1.X
Votes
0
Found in
2021.3.45f1
2022.3.51f1
6000.0.25f1
6000.1.0a2
Issue ID
UUM-85587
Regression
No
“Shader error in 'Hidden/VFX/.../Minimal/Render Quad': undeclared identifier 'mainTexture' at line 2198 (on d3d11)” error appears when connecting a Switch Node output to the Main Texture in VFX Graph
Reproduction steps:
1. Open the attached “VFXURP.zip” project
2. Open the “SampleScene” (Assets > Scenes)
3. Open the “Main Texture Bug Demo.vfx” from the Project Window
4. Click Compile
5. Observe the Console
Expected result: No errors or warnings
Actual result: “Shader error in 'Hidden/VFX/Main Texture Bug Demo/Minimal/Render Quad': undeclared identifier 'mainTexture' at line 2198 (on d3d11)” error
Reproducible with: 2021.3.45f1, 2022.3.51f1, 6000.0.25f1, 6000.1.0a2
Reproducible on: Windows 11
Not reproducible on: no other environment tested
Notes:
- Error might appear instantly after opening the Editor or after a fewer steps
- Does not reproduce in BiRP and HDRP
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Error “Shader error in 'YSCloudCover': call to 'tex3D' is ambiguous at Assets/YSCloudCoverText.shader(606) (on d3d11)“ is present when compiling tex3D shader with DXC
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
Resolution Note:
The switch (or any branch-based operator) will not function correctly if used to swap textures based on GPU evaluation—such as using a per-particle random value in this case.
Texture branching has been enabled starting with version 2023.3.0a1; however, this functionality is only valid when inputs can be evaluated on the CPU.
We acknowledge that this issue currently lacks constructive error feedback within the graph. Improvements to address this are under consideration, but please be advised that they will not render this graph valid.
For this specific use case, I recommend exploring flipbook integration. The `texIndex` attribute can be assigned a random value per particle, allowing for the desired texture variation.
Please refer to the documentation for more details: https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@17.0/manual/Context-OutputSharedSettings.html
Resolution Note (6000.1.X):
The switch (or any branch-based operator) will not function correctly if used to swap textures based on GPU evaluation—such as using a per-particle random value in this case.
Texture branching has been enabled starting with version 2023.3.0a1; however, this functionality is only valid when inputs can be evaluated on the CPU.
We acknowledge that this issue currently lacks constructive error feedback within the graph. Improvements to address this are under consideration, but please be advised that they will not render this graph valid.
For this specific use case, I recommend exploring flipbook integration. The `texIndex` attribute can be assigned a random value per particle, allowing for the desired texture variation.
Please refer to the documentation for more details: https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@17.0/manual/Context-OutputSharedSettings.html