elm-explorations / webgl

Functional rendering with WebGL in Elm
https://package.elm-lang.org/packages/elm-explorations/webgl/latest/
BSD 3-Clause "New" or "Revised" License
117 stars 17 forks source link

Add support for OES_standard_derivatives extension? #24

Closed ianmackenzie closed 4 years ago

ianmackenzie commented 4 years ago

Following up from https://github.com/elm-community/webgl/pull/48, https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices lists OES_standard_derivatives as a "universally supported WebGL 1 extension". So it should be fairly safe to add

gl.getExtension('OES_standard_derivatives');

to the JS context initialization code and prepend

#extension GL_OES_standard_derivatives : enable

to each generated fragment shader. This would then open up a bunch of cool possibilities for things like edge highlighting.