On 7/22/2011 9:32 AM, Fred Maulir wrote: > 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 ?
You can't set a uniform. The most common method of extracting data from shaders is to write to a (possibly small) texture that is then read back and analyzed by the host code. -- Chris 'Xenon' Hanson, omo sanza lettere. [email protected] http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

