No spot/point lights in WebGl on iOs

I’m working on a “simple” WebGL site. I’ve got a very basic scene with one point light in there without a shadow. It shows fine on all android devices. Also on pc and Imac it works fine. Except for iOs. On the Iphone and Ipad there is no light showing in the scene. It’s build on WebGL1.0 in the latest Unity version. I’ve tested it on the latest stable Unity build too and no difference.

Here is the example:
https://cfxsquad.nl/pointlight/

Hope you can help me out!

It looks the same on my Mac (safari, firefox) and on my iPad(pro).

Im sorry. My bad. I’ve updated this scene. This is the correct link:

I’m sorry i linked to the wrong project. I’ve updated my post. This is the example scene I’m talking about.
https://cfxsquad.nl/pointlight/

We have the same issue fwiw. Our artists had to get creative to workaround it. IIRC not exactly a Unity bug as the lights worked on older Safari versions, but not newer ones. Hard to recall as it’s been this way for like 2 years.

How did the artists work around this? Any advice you have for me?

I see the pointlight in Firefox (as a vertex light), but not Mac Safari.
Scene failed to launch with a javascript error on my iPadPro.

I think Safari is sabotaging you. Can you bake the lighting?

Does cfxsquad.nl/asm work for you? I will combine light mapping with directional lights and make seperate layers for different objects to assign direct lights only to these objects to fake some point lights ish effect.

Yes, loads on my iPad

I am fairly positive this is due to something that we reported to Apple a while back, and they have since fixed, here is the bug: 169999 – texImage2D for a half-float texture only accepts null .

As a really wild test, the following local hack might work around this: edit C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\library_gl.js, find around line 550:

if (!ctx) return 0;
var context = GL.registerContext(ctx, webGLContextAttributes);

and replace it with

if (!ctx) return 0;

ctx.realGetSupportedExtensions = ctx.getSupportedExtensions;
ctx.getSupportedExtensions = function() {
return this.realGetSupportedExtensions().filter(function(ext) {
return ext.indexOf('texture_half_float') == -1;
});
}

var context = GL.registerContext(ctx, webGLContextAttributes);

and do a re-export of the project. (You can also do the change to an already built development project by finding the same location in the generated framework.js file)

Not sure if the above workaround really works, but might be worth testing out.

3 Likes

Yes this works!!! Thanks @jukka_j !!!

This work around worked for us. Thank you!

works for me too, thanks so much!