(question) how to composite multiple children using blendFunc
See original GitHub issuequestion
library version
3.6.0
npm ls gl-react gl-react-dom gl-react-native gl-react-expo
gl-react@3.6.0
└── gl-react-dom@3.6.0
This should be a relatively simple question, but I’m not seeing an easy way to composite multiple nodes together while being able to take advantage of the parent node’s blendFunc.
The only way I can currently see of implementing this is to re-implement the blendFunc in the parent node’s shader and have the multiple children passed in as textures, but this seems really backwards, so I’m guessing I’m missing something. None of the examples really use blendFunc
or composite multiple children together.
Here’s a jsfiddle with a DOM example of what I’m trying to accomplish.
Also, I absolutely love using gl-react
– keep up the great work!! 😃
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Using multiple blendfunc OpenGL - alpha - Stack Overflow
You can create an offscreen Framebuffer Object with a texture attached to it. Perform the first render using glBlendFunc(GL_ONE, GL_ONE) then flip the...
Read more >WebGLRenderingContext.blendFunc() - Web APIs | MDN
The WebGLRenderingContext.blendFunc() method of the WebGL API defines which function is used for blending pixel arithmetic.
Read more >Tips and Tricks - deck.gl
Note: that there is a caveat with setting mix-blend-mode , as it can affect other peer HTML elements, especially other map children (perhaps...
Read more >Untitled
... "blendColor", "blendEquation", "blendEquationSeparate", "blendFunc", ... "childElementCount", "childNodes", "children", "chOff", "cite", "city", ...
Read more >Quick question about blur and bloom : r/opengl - Reddit
Make a copy of the texture. Blur the copy(could be done by downscaling and upscaling if you want performance). combine textures in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree this should be a
gl-react
primitive. I’d go withLayer
singular as it’s one fbo surface with multiple child nodes.There’s a precedent we can learn from in every retained scenegraph. The only other option I could see is that we don’t introduce a new Node type, and instead,
Node
recognizes if it has multiple children and uses itsblendFunc
to blend them on top of each other in this specific case. This is what I thought would happen, for instance, the first time I tried usinggl-react
. That being said, I’d prefer to stick with the explicitLayer
container for now.Hi, Any progress on this?