H Jeremy, Rendering transparent objects in 3D graphics is full of various issues related to the way the hardware z buffer is implemented through to the way data is deliverd, I'll leave it to others to go into details, search the web will also give you a good background.
W.r.t managing colours, you could bind it overall but this will just give you a single colour. If you want a colour per group of triangles then you could create a PrimtiveSet for each group and then have BIND_PER_PRIMITIVE_SET, but for large numbers of primitive sets this will be very expensive to dispatch to OpenGL. The other alternative is to replicate the colours for each vertex, this is more expensive of colour array size but more efficient in driving OpenGL. W.r.t tex coords the osg::Geometry only supports per vertex tex coords, no other variations are possible at present. Finally perhaps a custom drawable might the way to drive you app most efficiently. The instancing extensions that NVidia published at end of last year on the release of the 8800 might be particularily useful to you. Robert. On 3/6/07, Jeremy <[EMAIL PROTECTED]> wrote:
I think I need a little help to find a better way of rendering transparent objects. I have a large geometry model that consists of a huge amount of triangles. I want to render it such that it's transparent and colored. So is it true that I have to use textures to render it transparently? What is the best way of applying a single color transparently to these millions of triangles? Also, in my code, I have something like: Geometry* geometry = new Geometry; geometry->setVertexArray( vert_ary ); geometry->setNormalArray( norm_ary ); geometry->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE); geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, num_vert_indices,vert_indices); geometry->setTexCoordArray(0, tex_ary); Now, something I have an issue with is the tex_ary. Basically I'm repeating the exact same four coordinates from my texture per triangle (a single color). Is there a better way of doing this than repeating potentially millions of the same four texture coords? Thanks, Jeremy ____________________________________________________________________________________ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
