Robert is right!
cheers
zhuwan
yuan month=1,16,2014
在2014-1-16 17:10:08,"Robert Osfield" <[email protected]> 写道:
-----原始邮件-----
发件人: "Robert Osfield" <[email protected]>
发送时间: 2014-1-16 17:10:08
收件人: "OpenSceneGraph Users" <[email protected]>
主题: Re: [osg-users] Help migrating away from BIND_PER_PRIMITIVE
On 15 January 2014 20:40, Ethan Fahy <[email protected]> wrote:
Thanks for bearing with me Robert, I do realize that there has been much
discussion over this topic (I have spent hours trying to understand it all but
OSG is the only exposure to OpenGL that I've ever had so trying to understand
it all is tricky for me).
You mention using the osg_deprecated to tide me over, but I'm wondering what is
the more appropriate long-term solution. 燭o be clear, I don't need to support
any existing geometry that contains BIND_PER_PRIMITIVE (i.e. I don't need to
use fixDeprecatedData(). 燱hat I do need to do is to be able to create new
osgGeometry objects with osg3.2 and future versions of osg that allow me to
have the end-effect of coloring each primitive individually. 燦ow, if I am
understanding correctly, what I will have to do when creating new geometry is
to only put a single primitive in each primitiveset and use
BIND_PER_PRIMITIVE_SET. 燤y understanding is that BIND_PER_PRIMITIVE_SET is
supported in OpenGL and that this will not be deprecated any time soon. 燚o I
have this more or less correct?
BIND_PER_PRIMITIVE_SET is OK to use, it can be used relatively efficiently with
all versions OpenGL. 營t could result in lots of OpenGL calls though as you have
fine grained primitive sets that each have to be sent to OpenGL. 燩erformance
witse this is still be more efficient than what the OSG was having to do with
BIND_PER_PRIMITIVE though as here it had to duplicate data and reorder before
sending it OpenGL.
The route with best performance on modern hardware would be to duplicate the
vertices and use per vertex colours. 燭his route would allow you to use a single
DrawElementsUByte and lead to less OpenGl call overhead, which typically saves
more than the cost of the extra data.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org