Search Issue Tracker
By Design
Votes
0
Found in
2021.3.33f1
2022.3.15f1
2023.2.4f1
2023.3.0a19
Issue ID
UUM-59092
Regression
No
Backface stencil doesn't work when used in WebGL Build
How to reproduce:
1. Open the attached project "WebGLStencilTest2022.zip"
2. Build And Run the project for WebGL
Expected results: Backface stencil works in the WebGL Player
Actual results: Backface stencil doesn't work in the WebGL Player
Reproducible with: 2021.3.33f1, 2022.3.15f1, 2023.2.4f1, 2023.3.0a19
Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested
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
- Spot Light with 'Box' Shape stops working when it collides with Mesh
- Accepting Asset Store EULA endless loop in Package Manager window
- “InvalidOperationException: Sequence contains no matching element“ error when reenabling a custom Debug Draw Mode
- Prefab that contains a layout group is marked as changed by the Editor when opened
- Emission animation does not appear when the "Emission Map" parameter is set to black in a Lit material
Resolution Note:
There are a couple issues in the project that are causing the differences between WebGL and the Editor.
1. The Quality mode for Standalone is set to High Fidelity, but the Quality mode for Web is set to Balanced. The render setup was done for High Fidelity but not Balanced, so the web build will not have any of that render setup. Change the Quality setting for Web to High Fidelity to get the same render settings.
2. ModCubeMaterial points to GeneratedFromGraph-ModCubeShader. It looks like the Cull mode was edited for the shader. But it was only changed for the first SubShader, which excludes the GLES renderers. There is a second SubShader that is for the GLES renderers, and the Cull and Stencil values were not changed there. I copied the Render State values from the first subshader to the second one so that the GLES and non-GLES subshaders are consistent.
After I changed these two things WebGL rendered in the expected way.
The same issues would have been seen if you changed the Standalone graphics API to OpenGLES3.