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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org