4.9P4 HTML5 Point Light Issue

One of the new features in 4.9 is movable point lights in ES2 rendering mode. I’ve tested them in the ES2 in-editor preview mode, and they work great. Unfortunately, when run in an actual browser in HTML5 mode they cause problems. Visually, with any point lights in the scene any lit geometry either disappears or is massively mangled. I’ve created a test project that reproduces the issue: https://github.com/Quadtree/UE4HTML5PointLightIssue

Simply launch into HTML5 mode and you will see only the sky (which is unlit) and not the gray block that shows up in the editor. Removing the red movable point light fixes the issue in HTML5 mode. I’ve also attached the log that is printed when the issue happens in Chrome. Looking at it, it looks like the problem is that the GLSL pixel shaders contain instructions that are optional in the OpenGL ES2 spec, and it seems that Chrome and Firefox don’t implement them. Specifically:

for (;;)

and

f63 = pow((1.000000e+000+(-clamp(dot(v74,v74),0.000000e+000,1.000000e+000))),pu_h[i62].w);

I’ve been able to reproduce this issue on 4.9 Preview 4 and master, with both Chrome 44.0.2403.155 and Firefox 43.0a1.

Hi quadtree -

Thank you for your report. We are currently investigating this issue internally. I have added your information to the bug report, UE-20202.

Eric Ketchum

Hi Eric,

I’m still looking for a decent solution this issue as the WebGL code is generated by a cross compiler and is not easy to change the way it outputs for loops.

But as a workaround you can uncheck the checkbox under Project Settings, Engine - Rendering, Mobile, Use Shared Dynamic Point Light Shaders. This prevents the issue as it builds independent shaders without the for loop.