Hi Gerrit,

that would have been to beautifully, if that would had worked completely at once.

Yes, it works, but not really. At the beginning, I put my particle positions (as float texture) initially to the shader and want to compute their new positions. For this texture I have the following properties. Target: GL_TEXTURE_2D, InternalFormat: GL_RGBA32F_ARB. In the shader, I access the sampler2D texture by the texture2D command.

I use your glReadBuffer to get some kind of output for the current positions stored in that texture, initially they are like this:

45.078125 3.000000 50.000000 0.000000
45.234375 3.000000 50.000000 0.000000
45.390625 3.000000 50.000000 0.000000
45.546875 3.000000 50.000000 0.000000
45.703125 3.000000 50.000000 0.000000
45.859375 3.000000 50.000000 0.000000
46.015625 3.000000 50.000000 0.000000
46.171875 3.000000 50.000000 0.000000
46.328125 3.000000 50.000000 0.000000
46.484375 3.000000 50.000000 0.000000

This output is correct!

Then I write the positions back to the texture. In the next Rendering pass, I want to load the output texture (GL_TEXTURE_RECTANGLE_NV, GL_FLOAT_RGBA32_NV) as input texture and that does not work, because the properties are not correct. Thus, I changed the properties of my first input texture to the properties of the output texture. In the shader, I changed sampler2D to sampler2DRect and the texture2D command to texture2DRect.

But now my particle positions are initially all the same (all like the first position of the correct output above), like this:

45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000
45.078125 3.000000 50.000000 0.000000

Do you have an idea, why? Do I have to do something with the texture coordinates?

bye,
Oliver


Gerrit Voss schrieb:

Hi,

On Mon, 2005-10-10 at 23:42 +0800, Gerrit Voss wrote:
I'll try to look at the original problem which was rendering to a float
texture with fbos. I know that it works in principal (we do it without
OpenSG on nvidia  hardware). So there might be only some parameter
tweaking needed.

ok, I played with the parameters a little bit and got something
working,  attached a small test program that just dumps some float
values into a texture and reads them back.

Due to older hardware I had to use the nvidia float texture / texture
rect extensions but I give it a try later on and see how to get it
running with the arb floating point texture extension.

The program should just print 10.0 11.0 12.0 13.0 (the values from
the fragment shader). If you use the mouse (right mouse button) you
might see 22 23 24 1 which is the background color.

regards,
 gerrit



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to