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