PDA

View Full Version : 32 bits floatting point blending



antwann
12-14-2004, 12:57 AM
I need to render a particle cloud using blending with unclamped values. I did implemented a 16 bits floating point blending with no problems. But I have not enough precision in this case. In fact, I found that I loose precision when more than 1000 particles are projected on a pixel.

That's why I want to use 32 bits blending no matter of performance. I tried to use a pBuffer and fragment programs to do so. But it seems that I cannot bind the pBuffer in order to read from it as a texture while I'm rendering to it because of reading latency.

Do you know a way to do it?

Thanks

squarewithin
12-14-2004, 01:42 PM
No currently available cards support 32bit FP blending. The NV40 cards support FP blending on 4-channel 16bit FP buffers only. There is no way to what you want currently.

endash
12-14-2004, 02:35 PM
You may want to try alpha dithering. I havn't tried it myself, but there's a paper on it somewhere; it sounds like it should do the trick.

antwann
12-14-2004, 11:36 PM
In fact, i don't want to use 32 bits blending using GL_BLEND. I know it doesn't work. My idea is to use two distinct pbuffers and two distinct fragment programs. I enable the first pBuffer in order to write in it and bind the second pBuffer to TEX2 unit.
Then I render the particle using this fragment program :

!!FP1.0
TEX R2, f[WPOS], TEX2, RECT;
TEX R0, f[TEX0], TEX0, RECT;
MUL R1, f[TEX1], R0;
ADD o[COLR], R1, R2;
ENDTEX0 contains a gaussian texture associated to my particle, f[TEX1] is the color of my particle which I don't want to be clamped.

Then I switch the rendering pBuffers, bind the first pBuffer as TEX2, and bind a copy fragment program:

!!FP1.0
TEX R2, f[WPOS], TEX2, RECT;
MOV o[COLR], R2;
ENDThis program copy the data from the first pBuffer in the second one in order to be read when rendering next particle.

I thought it would work but it don't. But I'm new to use of multiple pBuffers and I don't know if I can switch from one to the other while in rendering process...