Sorry I'm coming into this discussion late.
In addition to Chris's good advice, another possible option for you is transform
feedback:
http://www.opengl.org/registry/specs/EXT/transform_feedback.txt
http://www.opengl.org/registry/specs/ARB/transform_feedback2.txt
http://www.opengl.org/registry/specs/ARB/transform_feedback3.txt
Conceptually, you bind a buffer object to GL_TRANSFORM_FEEDBACK_BUFFER, do some
rendering, then map the buffer object and examine the results.
I haven't looked close enough at the OSG support to see how you'd do this, and
there aren't any examples. It seems like you should be able to bind a
BufferObject in a Camera pre-draw callback, then map it back to the host in a
post-draw callback. But that doesn't appear to be the use case that
TransformFeedbackBufferBinding is designed for.
Hope this helps.
-Paul
On 7/22/2011 9:32 AM, Fred Maulir wrote:
Hello,
I developped a texture projective mapping (TPM) using vertex and fragment
shader and what I would like to do now is to get the information whether an
object has been lit or not by the TPM.
I was thinking of setting a uniform value to 0 in osg through the setUniform
function and change it to 1 in the pixel shader if any of the pixel has been
lit by the tpm shader.
Setting the value to 0 is not complicate but I can't retrieve the value of the
uniform modified by my shader. Is it possible ? Or is what I'm doing completely
stupid ?
Thanks for your help.
Wallysx
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org