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.

Enable WebGL 2.0 (if possible)

See original GitHub issue

On many Android devices, the required extension EXT_shader_texture_lod is not available for WebGL 1.0. Result is, that IBL does not work on these devices.

However, using WebGL 2.0 - which is available on many Android devices - eliminates this problem, as the extension is automatically included.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
UX3D-wahlstercommented, Dec 25, 2018

I agree, that supporting only WebGL 2 is bad for compatibility, with Microsoft switching to Chromium for Edge, only Safari remains incompatible. Maintaining two sets of ever growing (more extensions, materials, antimation) more complex shaders will cost time and is prone to errors. If possible, i’d like to reuse most of the shader code using the include system. We could prepend #version 300 es when we detect a WebGL2 context and also define WEBGL_V2 to check if we should replace certain key words and functions. If we put macro defines in a header that’s included before all others, we can hide some of the ugliness and do something along those lines:

#ifdef WEBGL_V2
    #define V_IN in
    #define V_OUT out

    void exportColor(vec4 color) {}
#else
    #define V_IN attribute
    #define V_OUT varying

    void exportColor(vec4 color) { gl_FragColor = color;}
#endif // !WEBGL_V2

I think this is a reasonable compromise, but maybe we can come up with a cleaner solution starting fresh after the holidays.

1reaction
UX3D-noppercommented, Dec 24, 2018

We stay at WebGL 1, whenever possible, However, LOD texture lookup is required for IBL. This is included in WebGL 2. Strategy is: If WebGL 2 is available, use it. If not, use WebGL 1. If EXT_shader_texture_lod is not available, no IBL is possible and only punctual lights are enabled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a WebGL Implementation
WebGL 2.0 is first supported on desktop platforms in Chrome 56. As of this writing, it may be enabled on Android by navigating...
Read more >
How To Enable Webgl 2.0 On Windows 10 [2022] - YouTube
How To Enable Webgl 2.0 On Windows 10 [2022] Subscribe for the next update notification: ...
Read more >
3 Simple Ways to Enable Webgl - wikiHow
1. Open Google Chrome {"smallUrl":"https:\/\/www.wikihow.com\/images\/c\/cd\/Android7chrome.png","bigUrl":"\/images\/thumb\/c\/cd\/Android7chrome.png\/30px ... 2. Type chrome://settings in the address bar. The address bar is at the top of Google Chrome....
Read more >
How to turn on WebGL in my browser - Human Support
Go to chrome://settings in your address bar, or click the three dots in the upper-right corner of the browser window and select Settings....
Read more >
How to Turn on WebGL in Your Browser - Lexia Help Center
WebGL should be enabled in recent versions of Chrome. If you aren't able to run WebGL in Chrome, make sure that you update...
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