Sampling with uv2 fails in IE11 and Edge

Sampling with the uv2 attribute (for AO maps, lightmaps) is broken in IE11 and Edge. The issue is described at The experiment uses a MeshStandardMaterial with few maps (color, normal, roughness, metalness and a PMREM envmap) and an AO map. You can see the expected render with any other browser. But if one tries on IE11 or Edge the result is :

The problem gets fixed if uv is used for sampling instead of uv2.

Three.js version
  • Dev
  • r84
  • r83…
  • IE11
  • Edge
  • Windows

(Note : I’ve failed to write a custom material without uv2 from the standard one via ShaderMaterial to show both results in the same experiment. This led me to ask the correct way for this on stackoverflow, reproduced on the three.js forum.)

Author: Fantashit

1 thought on “Sampling with uv2 fails in IE11 and Edge

  1. So to debug this I would try to identify if the issue is in the vertex shader or the fragment shader or in the data flow (uploading of the data.)

    (1) I would try modifyng the vertex shader to pass UV2 to both UV1 and UV2 and see if at least the OA map looks right. Basically this would allow ruling out the issue is with the upload of the UV2 data.

    (2) I would then undo that change and then look to force UV2 in the fragment shader to the AO map and avoid any logic with regards to that enabling UV2 — no defines or anything, because they could be the problem.

    (3) If I can force it I would add back the logic to conditionally define UV2s in the fragment shader and see if they work and which is failing.

    To sum up: Main Memory -> Vertex Shader -> Fragment Shader. I would ensure that the data can be fine in each stage. When I can not get the right data in one stage then I would look at what conditions or modifications to the data that are there and see if I can remove them and if that helps. Basically it is a search approach. I think it would take a couple hours to do.

    I’ve done this before for the Nexus 5 issues and the PBR shader issues.

Comments are closed.