Mattias Thell wrote:
But, nothing shows up on the screen. There are no GL errors reported. Changing
the code to use regular vertex arrays (without binding the vbo and changing the
glVertexPointer call to take an array), things shows up fine. Ofcourse, this is
not what I want.
Not really enough info to tell what's going wrong, but here's my best guess.
OSG sets up the view matrix and near/far planes based on the bounding
box of your Drawables. If you are doing your own drawing, and you did
not setInitialBound() on the Drawable, then OSG has no idea where your
Drawable is in space or how large it is, so can't set the view and
near/far planes. You won't see anything rendered because the view and
projection transformations are not "looking" at your geometry.
I've been doing quite a bit of work with custom/shader-based Node,
Drawable, and RenderStage classes recently, and I've found that these
types of OSG features account for about 80% of the issues I encounter
when I write code like this.
Useful debugging aid: Create a super-simple scene graph, then set a
breakpoint down in CullVisitor::apply(Geode&) and watch what happens in
the Drawable loop.
I hope I have an OpenGL capture utility up and running shortly (thanks,
Eric S., if you're reading this!) and that would be another handy tool
for these types of issues.
Hope that helps,
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org