- Home /
Webgl 1.0 error shader loop, workaround?
it seems webgl doenst support some kind of loops in the hlsl shader. My shader only have this variant. I wanna know a workaround this problem if possible and if anyone know in the future if these issues will be solved. Like tis version of WebGL 2.0 coming. My shader use a loop to iterate through points to print decals , it is a fragment shader.
Error log is ERROR: 0:37: 'while' : This type of loop is not allowed.
I already looked at https://docs.unity3d.com/Manual/webgl-graphics.html
It seems this guy discuss well this issue http://www.at$$anonymous$$d.nl/?p=623
alright it seems to be working on broswers that support webgl 2.0! hope it becomes standard soon
Answer by wenderRondonia · Apr 30, 2017 at 04:00 PM
alright I unrolled the for loop so now it works with webgl 1.0, good things most of browsers now support 2.0
Answer by EpicCubeGroup · Aug 03, 2018 at 10:31 AM
Same problem here. Unfortunately not all browsers support webgl 2.0 yet. I've posted a thread on unity forum too: https://forum.unity.com/threads/shader-compilation-issue-for-webgl.543613/ Any solution found?
Your answer
Follow this Question
Related Questions
No shadows when building with WebGL? 1 Answer
How is _WorldSpaceLightPos0 calculated for a directional light? 0 Answers
Asset bundle shader standard 0 Answers
Blit into Texture2DArray slice not working in WebGL 0 Answers
How do I implement 2 sided transparent objects (especially for WebGL)? 0 Answers