Hi,
I seem to have run in an error, where node materials would not compile on safari browser. It seems to throw an error related to gl_instanceID undeclared identifier (sorry I do not own a mac product and could not copy paste it). It seems to be related to this issue: ios - Use of undeclared identifier 'gl_InstanceID' - Stack Overflow
Are instances normally supported on OpenGLES2.0 / Safari by BabylonJS? If so, then I guess the new node materials might miss a fallback function? I guess it is related to the Instances Node Block.
I could test on a iPhone SE. It reports that it supports instanced arrays but does not support gl_InstanceID whereas it should. Or at least it should support gl_InstanceIDEXT but it does not support it neitherā¦
So, I donāt know how we should handle thatā¦
Note that enabling the WebGL2 experimental support make the PG work.
I havent tested if PBRMaterials work. But so far the issue only appears, if I use the Node Material. Would this mean that gl_InstanceIDEXT works for other materials, but not for Node Material?
Only the node material Instances block uses the gl_InstanceID variable, the standard/PBR materials donāt use it. This variable is only provided by the node material if the user needs it for some reason but the Instances block would work without exposing this valueā¦
Yes, but how to detect that gl_InstanceID is supported? iOS does support it in some cases as when I enabled WebGL2 experimental support it did work⦠Maybe if iOS + WebGL1? Also, I could not test on MacOS as I donāt have a Mac, we would need to know if gl_InstanceID is supported on MacOS + WebGL1.
I just got his issue again in Safari on Mac and iPhone whit BabylonJS 4.2 and I see that his PR is not working anymore. I got the same issue. This fix is not working anymore or what is the reason for this?
The PR was bugged and has been fixed in march this year, so for 5.0 only.
What you can do is set engine.getCaps().canUseGLInstanceID = !engine.getCaps().canUseGLInstanceID; to disable usage of gl_InstanceID (the bug was that the meaning of canUseGLInstanceID was reversed).