-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(question) how to composite multiple children using blendFunc #127
Comments
Hi, Currently |
one more thought on this: technically, I imagine Node can detect to use the Group's fbo if I need to give more thoughts on many impl details, but basically maybe Group should act like Node in that it's part of the dependent draw system. e.g. Group#_draw() probably needs to delegate the draw calls sequentially in order to all the Node children. I probably should do a PoC to see if all these can work out :) |
The name some names idea: Group, Layer, Blend, Chain, NodeGroup, Sequence, All, Combine, Compose, Composite,... |
it's kinda like layers in photoshop/Gimp I guess? any existing vocabulary? I think maybe |
I agree this should be a 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, |
good thoughts! so actually Node supports children, but it's currently only to have an alternative syntax to compose things: <Node
shader={shaders.pixelEditor}
uniformsOptions={{
t: { interpolation: "nearest" },
}}
uniforms={{
size,
gridBorder,
brushRadius,
mouse,
color,
}}
>
<Bus uniform="t">
<Paint {...rest} />
</Bus>
</Node> (from https://gl-react-cookbook.surge.sh/pixeleditor ) A "Bus" don't render anything but is a way to "connect" something (from the rendered children to the contextual parent) (in this case, it connects Paint to uniform t). now, if you directly give |
this would be absolutely amazing! |
Hi, |
question
library version
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!! :)The text was updated successfully, but these errors were encountered: