[osg-users] different materials for a geometry and highlight

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Wed Sep 28 08:09:14 PDT 2016

Am 9/28/2016 um 4:57 PM schrieb Gianni Ambrosio:
> Hi Sebastian,
> I would like to adopt you solution if possible but I was not able to implement with textures the same behaviour of the example I did with primitive sets.
> I know that on windows the example crashes in debug mode because of an assertion inside Microsoft implementaition of std::vector. It's a matter of  _ITERATOR_DEBUG_LEVEL. In release mode it works fine. Just to explain the reason. Anyway the movie should not crash :D
Movie is working ;)  But if it is giving you an assertion in debug and 
works in release mode it simply means you're using undefined behavior. 
You should never rely on something like this.
> So, do you think it would be possible to implement the same behaviour with textures?
Not directly. If you really need to tag individual triangles it isn't 
doable with a simple texture. In this case my next approach actually 
would include using vertex colors and some shader to draw flat colored 
triangles based on the provoking vertex.
The problem that makes this non-trivial is simply due to the vertex 
sharing. If you duplicate the vertices (or at least some of them) it is 
solveable without fancy tricks in 5 minutes, but depending on the number 
of triangles in your road this might not be an option.
So how many triangles will be in your road?

> Regards,
> Gianni
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68814#68814
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list