-
Notifications
You must be signed in to change notification settings - Fork 23
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
VP_LINK_FBO : A render pass for each object ? #54
Comments
Hey Daan, but only internally, so no cable now, but i don't see no problem adding an VP_LINK_FBO cable and start implementing new objects using it, the only thing we need to decide is what to share with this cable, maybe the ofxPingPong? Let me know what you think ( sorry for the bad handwriting! ) |
Hey Emanuele, thanks for the awesome hand drawing. Ideally, ofxPingPong should be setup with a single fbo allocation, dynamically allocating the 2nd one if pingpong is needed by one of the connected objects, with a neutral class interface (so that any object in the fbo chain can render with or without pingpong needs). |
Hey Daan, i'm thinking in coding a starting point for this new objects, so it would be easier to continue developing, i'm going to write the skeleton as i'm thinking it then we'll continue from there. I'll post it here when i have it! |
Ok, feel free to push to the |
Fast question, i'm implementing the surface fbo objects, and for what i understand your idea was to have just one shared ofFbo with a incremental quantity of numColorbuffers, shared between a possible effects chain ( various fbo effect objects ) So:
Is that right? |
If you're talking about surfaces as in #24 , they are different from fbo link-types but work in the same "chaining" way (composer-objects and link-type-chains), so surface link-types will be facilitated later on by the FBO "chaining" mechanism. To give a mixed example, a textureRender object could accept a surface (shape) and an fbo inlets, drawing the texture to the FBO in the shape of the provided surface (circle, rectangle, polygon, etc.; maybe defaulted to the fullscreen rectangle if no shape connected ?). That would implicitly mean that any surface-enabled object needs to be able to render to a Back to the FBO link type, as I see it, not sure if you're saying the same or not. (It's definitely not the same as your drawing above.)
Pingpong is probably confusing us... In fact, effects don't need to be aware of the previous effect's pixels (the swappable texture buffer), and should just blindly render to the fbo... except for ping-pong effect objects that do multiple render passes per frame, each one requiring the pixels of the previous pass. I hope that helps to understand eachother (?) 👼 |
Right, i understand your description ( i think ), i'm on it then! |
There it is, i've added a second outlet to the fbo effect, so there will be no need of the third and last object to do FBO2texture Now we have two options, write independent fbo effect objects ( fbo particles, fbo reactiondiffusion, etc.... ), or write packed fbo effect inside one object, and switching from one effect to another via the object GUI; both options are interesting, maybe it's best to adopt both, making specific effects, and effects group, for example. I'll commit the code soon |
Could you explain these 2 options in another way ? |
Right, the first option is what we were talking from the beginning, fbo effect objects, each one a specific effect, easy, the second one it would be an extended version of the first, simply including into one single object a lot of effects, maybe a group of related one for coherence ( as various type of image delay, or different type of blending or whatever ), and just select one or another via the object GUI ( for example a selector with multiple lines and only one selection at the time ) I don't know, it's not really important to have just the first type or both, so i suppose we'll see as we implement some effects- I already write a simple particle system fbo effect, just to test something, and it's working all ok. For the fbo composer and fbo effect template objects I still have to add a mechanism for re-init textures when changing resolution, but i already have one in place that is working for glsl shader and lua script, so it would be easy to do ( imagine a chain of fbo objects, inited by default with the STANDARD_TEXTURE_RESOLUTION, then finally connected to an output window for projection, then from the output window you change the resolution, at this point the final output texture will have a different resolution from the fbo effect chain, so a trigger must be sent in cascade backword, for re-init the texture at the new resolution)
With that done, they will be ready and i'll commit the changes |
Ok, I think I get it. Not sure about the 2nd option too. Why would we have an object where we can switch between reactionDiffusionEffect and particleEffect (maybe this could be achieved using a subpatch?). If one needs both (rare case), you can just create the 2 objects; if needing to switch rendering between them (cf: your GUI menu?), an fboMixer might do the job, no ? To me it sounds heavy and messy to put all kinds of effects into a big "gui switcher object". It's a good idea to put some backward (opposite-flow) communication between the composer and the effects, but I think it's a waste to change sizes dynamically. I'd rather imagine a warning mechanism indicating that "ideal effect resolutions" don't match. An FBO is like a texture and should have an always identical size. Each effect rendering to it should adapt to it. If a 800x600 fbo is connected to a 1920x1080 output, either it's drawn at scale 1 not filling the whole output, or either it's upscaled with pixellisation to fill the output. There could be an fbo-inlet in the fbo-composer object to fill the FBO with another FBO of a different size.
|
not solving anything, just putting stuff on the table, so not important, we stick to the first option for now, then we'll see i like the idea of different sizes, it would be useful to have a selector in the fbo composer GUI, with:
and the a button for adapt size to output, just in case so the control will be completely in the hands of the user |
Hey,
I just noticed, there's a way to send textures (
VP_LINK_TEXTURE
) from object to object, but nothing for rendering on an FBO... (or did I miss something?).Implementing some new objects (face tracker, countdown timer effect, flash effect, points renderer, etc.), I need to render several "rendered effects" on a final display output.
Currently, I guess that you have to put them in individual textures to be mixed/rendered together later, which doesn't make sense to me (regarding performance and GL logic).
Now each "render object" needs to allocate an FBO (in order to render), then extract that to pixels in a newly allocated texture (for output), which is then drawn in the fbo of the next object. Letting them render on the same FBO would be so much faster and lighter in memory usage. Also I guess there's a hardware limit on how much FBOs you allocate, different on each device, which would theoretically limit the creation of numerous render objects in Mosaic.
Would there be another way of "accumulating effects" in Mosaic ?
Is there some reason for VP_LINK_FBO links not to be already present ?
Maybe something like this ?
[ fbo_object ]----fbo---[particle_effect]---fbo---[other_effect]---fbo---[window_output]
In karmaMapper I used this class as extended ofFbo : karmaFboLayer.h
This link-logic could also be of use to my surfaces proposal in #24
Maybe then there could also be something like a FboToTexture glue object.
The text was updated successfully, but these errors were encountered: