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.

Node: escape hatch for more advanced WebGL stuff

See original GitHub issue

Node should expose a more generic escape hatch to use gl and do any WebGL stuff.

Node should expose a basic way to implement your own draw(). that way, people can do whatever they want with gl, but the contract should be clear (should you still receive the uniforms? is the shader in the scope? should there be a more generic contract that Node implements?). The simplest example is to call gl.clear() to fill a color. Try regl in this paradigm. Try Three.js in this paradigm.

The main problem is most WebGL libs are intrusive and alter the gl state (e.g. they don’t expect to just draw in the current bounded framebuffer).

e.g. https://github.com/mrdoob/three.js/issues/7483#issuecomment-264195243

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertjuhcommented, Apr 23, 2018

Awesome, following this thread.

1reaction
grecommented, Jul 20, 2017

status update: gl-react-native now expose the EXGLView directly, but there is still a usecase to have such an escape hatch that you want to render something with a lib into a FBO and pipe the result to the gl-react stack of effects.

probably this would not be part of <Node> like initially stated, but instead be a new component… the main concern with libs like Three.js is we need them to draw on a specific framebuffer and not directly on the canvas. so it might be something to fix in Three.js if we want the interop possible.

we also need to figure out how it would be possible to “save & restore” the GL states across libs and this sounds the main headache to having this whole feature possible maybe https://github.com/stackgl/gl-state solves that but also need to see if it’s not an overhead to have

Read more comments on GitHub >

github_iconTop Results From Across the Web

stackgl/headless-gl: Windowless WebGL for node.js - GitHub
gl lets you create a WebGL context in Node. js without making a window or loading a full browser environment. It aspires to...
Read more >
Reconcile All The Things - Acko.net
Like a scriptable node in a DFG, it's an escape hatch inside the run-time. But we're also still missing something: actual memoization. While...
Read more >
npmjs react
Npmjs ReactThe npm package react receives a total of 16,078,277 downloads a ... This is an escape hatch for working with heavily customized...
Read more >
Raw WebGL. While it is possible to render 3D… - Alain Galvan
Refer to this blog post on designing web libraries and apps for more details on Node.js, packages, etc. Project Layout. As your project...
Read more >
Solid: CHANGELOG.md | Fossies
No longer supporting hydratable DOM SSR in patched(ie... JSDOM) node environments. Use the standard SSR methods instead. Can still run Solid in JSDOM...
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