Hello Juan, I don't understand the fact that I need a swap per triangle. In the osggameoflife there is one swap per render pass. So my object is for example a wall (plane) and I want to add a texture (brush) to this wall like a airbrush. That is a simple test scenario.
Ok first of all I should try the additive blending with osg::TexEnv. After this I can try a example with the extension EXT_shader_image_load_store. I have a NV GTX470, it should work. And then we can talk about a integration in OSG. I can send the example and we can discuss a suitable design. I am very interested in a smoothly integration in OSG. Regards, Martin -------- Original-Nachricht -------- > Datum: Tue, 22 Feb 2011 11:38:15 +0100 > Von: Juan Hernando <[email protected]> > An: [email protected] > Betreff: Re: [osg-users] Can I increment the gl_FragData? > Hi Martin, > Depending on what you need to do, additive blend (as it has already been > suggested) may work fine. Using ping-pong is not an option if you need > to accmulate the output in a triangle basis because it requires a buffer > swap per triangle to guarantee correct results. > Can you be a bit more specific about what type of geometry are you > rendering into the target textures and what's the sequence of additions? > > If you need something more advanced, read/write random access to memory > buffers is actually possible, but you need a graphics card that supports > EXT_shader_image_load_store (at least NV GTX4xx or AMD HD5xxx). > However, OSG does not support that extension at all and there are > non-trivial synchronization/performance issues that you need to be aware > of when writing your shader code (restricted, volatile and coherent > variables; shader level and client level memory barriers; and atomic > operations). > > Indeed, I want to start making some experiments with that extension for > order-independent transparency, but proper support from OSG is not > straightforward. A new StateAttribute (similar to textures) is needed to > handle the binding of texture objects to "image buffer units" (a new > shader concept). Also, some mechanism, such as a post-draw callback or a > new scenegraph node, should be provided to execute the memory barriers > in the client side. > > I'd really like to have this extension smoothly integrated in OSG > because it is at least as interesting as hardware tessellation support. > I can volunteer to do part of the coding, but first I need feedback in > order to propose a suitable design. > > More info here. > http://www.opengl.org/registry/specs/EXT/shader_image_load_store.txt > > Regards, > Juan > > On 22/02/11 11:06, "Martin Großer" wrote: > > Hello, > > > > that is bad. :-( > > So, I want to blend (for example add) textures iterative. > > Here in pseudo code: > > > > while(1) > > { > > Tex0 = Tex0 + Tex1; // Tex0 + Tex1 is calculate in a glsl shader > > } > > > > Thanks for your tips. > > > > Cheers > > > > Martin > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

