Hi Ethan,

osg::Geometry still supports BIND_PER_VERTEX, BIND_PER_PRIMITIVE_SET and
BIND_OVERALL as these are able to map to what OpenGL supports directly.
 For you work I would suggest either using BIND_PER_VERTEX or
BIND_PER_PRIMTIVE_SET, the easiest one to map to is probably
BIND_PER_PRIMITIVE_SET so you'd have one building face per
osg::PrimitiveSet.  The most efficient in terms of OpenGL performance will
be to duplicate the temperature values so there is one per vertex and then
use BIND_PER_VERTEX.

Physically I would have thought the temperature would most naturally fit to
per vertex as the edges and corners of buildings will be at the same
temperature (one point is space can't be at two temperatures) but with
doing this one need to insert extra vertices with the flat walls to allow
to accurately map the temperature variation.

The other route you could take is put the temperature mapping into a
texture.

Robert.




On 13 January 2014 14:12, Ethan Fahy <ethanf...@gmail.com> wrote:

> I'd like to migrate away from my current usage of BIND_PER_PRIMITIVE so
> that I can start using current versions of OSG.
>
> I have working code that does color binding on a per primitive basis.  I
> believe I have a good reason to do so:  I have a separate program that
> tells me what the temperature is for facets on a building.  This means that
> I have one temperature value for each primitive.  I can convert the 3-D
> building model that the program uses into an .ive file.  I need to color
> each side of the building according to temperature, so the natural fit is
> to use BIND_PER_PRIMITIVE.
>
> The problem is that if I have a building in a single geometry object, it
> ends up having shared vertices which means I can't effectively color per
> primitive by setting all vertices the same color and coloring by vertex.
>
> The only solution I can think of is to split the single building geometry
> up so that each primitive in the building is its own geometry so that there
> are no shared vertices within the geometries and I can color each vertex by
> the color of the primitive.
>
> Am I missing anything?  I tried looking in the forum archives but I was
> confused by most of the conversation about this topic.
>
> -Ethan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=57865#57865
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to