question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RectAreaLightUniformsLib.js is broken on iOS 14

See original GitHub issue

Describe the bug

examples/js/lights/RectAreaLightUniformsLib.js does not work in iOS 14. It used to work on iOS 13 (with some linear banding artefacts in the reflection of the area light), but under iOS 14 an area light created using this library is simply black and gives no light.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://threejs.org/examples/?q=area#webgl_lights_rectarealight
  2. On desktop, the area light is completely white
  3. On iOS 13, the area light reflection has horizontal bands
  4. On iOS 14, the area light is black and does not illuminate the scene and an error message says “OES_texture_float_linear not supported”

Screenshots

Desktop (Chrome on Win 10):

image (9)

iOS 13 (iPad Air 2019 model):

File (1)

iOS 14 (iPhone 11):

File

Diagnosis:

The problem seems to be caused by a change in Webkit in Safari on iOS 14. Previously in iOS 13 Webkit would claim it supported the WebGL extension OES_texture_float_linear but it actually didn’t. Now in iOS 14, Webkit correctly reports that it does not support that extension.

Suggested fix:

Change RectAreaLightUniformsLib to fallback from THREE.LinearFilter to THREE.NearestFilter when the OES_texture_float_linear WebGL extension is not available.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
yellowtailfancommented, Sep 28, 2020

Thanks @Mugen87 we’ll look into that. It’s nice to know a PR would be welcome!

2reactions
yellowtailfancommented, Oct 8, 2020

I’ve created PR #20477 which uses half-float instead of float and renders area lighting without artefacts on Windows, iOS 13 and iOS 14.

I’ve put some to-do items and questions in the PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RectLight not working in safari - Questions - three.js forum
Yes. At least the developer of the PR could successfully use RectAreaLight on iOS 14 (and iOS 13). Sorry, I have no iOS...
Read more >
iOS 14 Webshare API Broken | Apple Developer Forums
Here are all the steps to reproduce: Go to MDN Webshare API. Find a link to Web share test in "Examples" section and...
Read more >
Sencha Touch/Ext JS paint event not triggered on iOS 14+
The first thought was something is broken on Canvas, because we couldn't draw anything on it. So I started debugging the part of...
Read more >
ES6 module fails on Safari mobile (iOS14.6) - Stack Overflow
I found the issue: the following library broke the JS execution in Mobile Safari as soon as a call was done to console.log...
Read more >
Textures Fail to Render in WebGL from HLS Stream [iOS 14]
Image comparing iOS 14 Beta 6 to iOS 13.6.1 (400.85 KB, image/png) ... From what I can see examples from babylon and tree.js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found