Hi Robert and all -- I've ran into an interesting culling issue and
wanted to raise it on the list in case someone thought there should be a
code change.
The issue is at CullVisitor.cpp line 746. This line of code causes a
Drawable to be culled if compute near/far is on, and the call to
updateCalculatedNearFar() returns false (because the Drawable bounds
place it behind the viewpoint).
I'm rendering a skydome with custom transformations in the vertex
shader, so the host bounding box is really quite meaningless. I want to
disable culling on the Drawable.
There seems to be two ways to handle this:
* Set a profoundly large initial bound. (This has the unfortunate side
effect of slaughtering the near/far computation.)
* Disable near/far computation just for this subgraph. I'm currently
doing this with a custom Group node. In the traverse() method during
cull. I disable compute near/far, traverse the subgraph, then restore
the saved compute near/far mode. (Is there a better way to do this?)
If I use either of the two options cited above, I feel compelled to add
lots of explanatory comments, because it's not clear to future code
maintainers that the reason I'm doing these things is to prevent culling
from happening.
In the presence of vertex and geometry shaders that do their own
transformation, it seems like others could run into this same issue. I
don't care whether there's an OSG code change or not, but wanted to
mention the issue for consideration by others, future archive searches, etc.
--
Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org