This type of problem is usually caused by missing data: colors, normals (if lighting), or texture coordinates (if rendering with texture enabled).

You might also see behavior that *looks* like the "missing data" problem if you change the normal, color, or tex coordinate data dynamically and forget to dirty the display list.

Your scene graph sounds pretty simple; what happens if you write it out to a .osg file and display it in the osgviewer app? Do you see the problem there, too?
   -Paul


On 10/10/2011 2:04 PM, Dan West wrote:
Hi Guys,

   I've come across this issue a few times now, and its gotten to the point 
where I really need a resolution. The details seem similar to what's documented 
here: http://forum.openscenegraph.org/viewtopic.php?t=401

Essentially, I'm setting two geometries to different colors, but they always 
show up as the same color (whether its the first or second). This first started 
happening when I was using a Box ShapeDrawable and a custom geometry 
(DrawArrays), so I switched the Box to a custom geometry (still a box), and 
made sure normals were set, but the same thing is still happening.

My main scene is using lighting, however this behavior is happening in a 
separate scenegraph I'm using for rendering to a texture. I tried adding the 
normals just in case the lighting was affecting the subgraph, but it didn't 
make any difference. The box / geometries I'm using don't have any materials 
set on them, so i would think this is the case for the 'default' material? Both 
geometries have vertex/color/normal arrays, as I only need a solid color for 
each.

Have I missed something here, or is there any other way to get around this 
issue. I've run into this in other projects too, so I'm really interested in 
figuring out how to avoid this, especially when using ShapeDrawables.

Thanks in advance,
~ Dan

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to