Hi Marcus,
Oliver Kutter wrote:
Now I want to compute the whole particle system with the shader and
don't write it back to the geometry. In the 1st pass I want to get
the current position of the particle and compute its new position
with the shader procedure, that I already have (I decoded the new
position as the color). Then, in the 2nd pass, I want to assign the
new vertex position computed by the fragment shader of the 1st pass.
And with the fragment shader of the 2nd I set the texture and the
color of the particle.
I think, it could be possible to compute the whole thing in one pass,
but I don't know how?
Given support for MRT (multiple render targets, which would mean using
OSGPassiveWindow for now, methinks) you could use the vertex program
to read from the particle state texture(s) and only simply to
transform each point into screen space, then do rendering _and_
calculate/update the state-texture(s) for the next frame in the
fragment program.
I use a second viewport with a PolygonForeground and a
TextureGrabForeground. That's the way I get my positions back to my
application.
But how can I read in the vertex program from the texture at the correct
texture position (where the position of the current particle position is
stored). In the fragment program I use an offset texture to indicate the
position of the current particle. But I don't know how to do this in the
vertex shader.
Bye,
Oliver
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users