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.

How to enable GLSL extensions like `OES_standard_derivatives`?

See original GitHub issue

Feature

How to enable GLSL extensions like OES_standard_derivatives?

library version

├── gl-react@3.15.0
└── gl-react-dom@3.15.0

Expected behavior

I tried using the onContextCreate function of the gl-react-dom Surface which exposes the gl instance to enable the extension via gl.getExtension('OES_standard_derivatives')

Actual behavior

Assigning a custom function to onContextCreate actually silently prevents any rendering from happening!

Is there another way to enable additional WebGL extensions?

Thx

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
subbluecommented, Mar 2, 2019

Thanks @brysonandrew, good to know that works. In the end I found a way to do what I needed without the derivatives extension, but good to know for the future 👍

0reactions
brysonandrewcommented, Mar 11, 2019

@efirdc You’re welcome, yes, componentDidMount.

Here is a gist of the whole component

Do you have something like this is your shader -

#ifdef GL_OES_standard_derivatives
  #extension GL_OES_standard_derivatives : enable
#endif

?

Read more comments on GitHub >

github_iconTop Results From Across the Web

OES_standard_derivatives - Web APIs - MDN Web Docs
The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx , dFdy , and fwidth .
Read more >
Enabling an extension on a Three.js shader - Stack Overflow
You have to use the renderer's dom element: var gl = renderer.domElement.getContext('webgl') || renderer.domElement.
Read more >
OES Standard Derivatives - Web APIs - W3cubDocs
The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth.
Read more >
GL_OES_standard_derivatives - Khronos Registry
The built-in derivative functions dFdx, dFdy, and fwidth are optional, and must be enabled by #extension GL_OES_standard_derivatives : enable before being ...
Read more >
GLSL language integration - Visual Studio Marketplace
Extension for Visual Studio - VSIX Project that provides GLSL language ... You can use environment variables, like %SystemDrive% in your ...
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