Hi,
try copying the input texture value to the output instead of using discard.
jp
Julien Valentin wrote:
Hello all,
I'm playing with the osg gameoflife example in order to implement a
FastIterativeMethod using the pingpong textures and a FBO already in the
example.
This iterative method is looping over several GPU loops (a pixel
shader) until it converges ( all pixels are set).
Pixel shader seems like it:
main(){
if (need to update current pixel)
gl_FragColor=updatedcolor;
else gl_FragColor=oldcolor;;
}
It work fine but there's no convergence test in order to stop looping in
the shader....
For the purpose of convergence test I would like to use an occulsion
query that return the number of pixel setted in a loop (not discarded).
For this I modify my shader:
main(){
if (need to update current pixel)
gl_FragColor=updatedcolor;
else discard;
}
So It discard fragment that dont need to be setted again with the same value
Now each pixel would update when it need otherwise it is would discard
itself.
But with this code the result on my textured quad s don't stop flicking
between correct color and a checkboard ..:(
Do you know where the problem is?
It seems to be like osg is not calling the two pingpong passes
alternately...
NB:To sum up, The only change I made from the osg gameOfLife example is
the shader where i introduces a discard branch...
------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org