Thanks Murray. I have to emphasize that by "is visible", I really mean
being visible in scene view, which is a fair bit more involved than just
"in view frustum".
I checked GLSL docs and there is no way for shaders to write to arrays
that could be read by GL app. However, I think I have figured out a way
using two-stage rendering: one pre-render (to texture) to compute a "z
depth array" which would store the z-depth and world x,y of only the
closest fragment, from which a "visibility array" could be updated, and
another render to change the color of the fragments on the final scene
view. Not trivial but very powerful if I haven't forgotten any
important requirement. The only assumption (based on GLSL docs) is that
a default-qualified variable in shaders does not get cleared between
frames or fragments.
Oliver
Murray G. Gamble wrote:
Hi Oliver,
One approach would be to use a dot product operation in a vertex shader that
tests vertex coordinates of candidate objects against the current view
frustrum for scene view A. If the angle between the gaze vector (centre of
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/