Hi,
I’ve read the glsl spec and this sentence hooked up my attention :
“A vertex shader may also read varying variables, getting back the same values it has written. Reading a varying variable in a vertex shader returns undefined values if it is read before being written.”
What does this exactly means?
Is it then possible to render a geometry, the vertex shader writes in a varying array the view space interpolated vertice. The array would be initialised at -1.0 everywhere so when adding a data we can easily find the next free element with a small loop(PS3.0 and Nv4x makes it possible).
But let us say that we have ten (interpolated)vertices that projects into a same fragment. I’d like to get back the varying array computed by the vertex shader before. Is it possible?
Also, do you think it is possible that once the fragment is treated for the first time, to stop the others 9 from being processed?
I don’t know if I made myself clear but if anyone has an idea I would appreciate having some advices.
Cheers, Jeff.