Hello,
I’m encountering issues with shaders when building my Unity project for WebGL, specifically related to the color space setting.
Issue:
- When I switch the color space to Gamma, I can build for WebGL, but I get the error:
RenderingCommandBuffer: invalid pass index X in DrawMesh
. - When switching to Linear, I can’t build for WebGL at all, as I get build errors related to shader compatibility.
- I have both WebGL1 and WebGL2 enabled in the Player Settings. Removing WebGL1 causes the same shader error.
What I’ve Tried:
- Switching color spaces between Gamma and Linear doesn’t resolve the issue.
- Enabling and disabling WebGL1/WebGL2 didn’t help.
My Setup:
- I’m using imported materials and shaders (not manually created), and I’m not sure how to modify them for color space compatibility in WebGL.
Help Needed:
- Any tips on resolving the
invalid pass index
error when using Gamma color space. - How to make sure imported shaders work properly with WebGL and different color spaces.
Thanks for any help!