On 11/16/2010 10:26 AM, Fred Smith wrote:
Hi,

I need to define an object that can be seen as a sphere - at least this is the 
most convenient analogy I can find right now.

- it is defined by meta-properties, essentially, like by its radius and a 
center position. It does not contain actual geometry data per se. The actual 
rendered geometry is completely dynamic.

- the object will need to use shaders in all cases. I might improve the 
implementation later so that it does not use shaders when they're not 
available, but shaders will be critical for a while.

What can I do here? ShapeDrawable operates at the drawable level, and seems 
inappropriate for me as I want to enforce the use of shaders, which is a 
Node-level concept.

The Drawable level is entirely appropriate. Shaders can be attached per 
Drawable.

I could derive from Geode, ignore all drawables underneath (not very elegant), 
but getStateSet/getOrCreateStateSet are not overridable, so I can't 
transparently add my shaders in there.

This is probably not the right way to go, use a Drawable instead. Nonetheless, you could certainly create a custom Node and add your own (private) shaders during cull with a cull callback, or by overriding traverse().

Would somebody mind giving me a hint or two about the way to go?

Why not just use an empty Geometry, with appropriate shaders attached?

--
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to