Hi Rui,

On 19 November 2014 11:53, Robert Osfield <[email protected]> wrote:

> Hi Rui,
>
> I have just reviewed your VertexAttribDivisor submissions and don't
> believe it's the best way to tackle the problem - in particular the state
> for the calls to glVertexAttribDivisor will bleed into other osg::Geometry
> that don't explicitly set it.
>
> I haven't yet thought deeply about the topic but my first thought would be
> that the osg::State::setVertexAttribPointer(..) method should probably take
> on responsibility for setting the value. There is also a mixing of the type
> of the divisor between GLint and GLuint depending upon where you are used
> the value.  I think one should probably just use GLuint as per the OpenGL
> implementation of glVertexAttribDivisor and use 0 as the default as per the
> OpenGL defaults as well.
>

One other issue I've thought of is that even if we push management of
glVertexAttribDivisor to osg::State to ensure that the state is reset
correctly this will only work for scene graphs where all the osg::Geometry
is rendered without display lists, if any osg::Geometry use display lists
then the state set in the Geometry could leak.  This issue suggests to me
that the glVertexAttribDivisor state would probably be best implemented via
a osg::StateAttribute, that way a default value could be handled without
any issues of use of display lists.

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to