[osg-users] distant nodes in orthographic projection turn black

Peter Amstutz peter.amstutz at tseboston.com
Wed Mar 18 09:05:09 PDT 2009

It's not erratic, it's pretty strongly correlated to the projection 
matrix settings (determining the zoom level), camera distance and size 
of the icon.

I looked at the icon model, from inspecting the .osg file (converted 
from .ive with osgconv) it appears that the relevant state settings are:

          GL_CULL_FACE ON
          GL_LIGHTING ON
          Material {
            DataVariance STATIC
            ColorMode OFF
            ambientColor 1 0 0 1
            diffuseColor 1 0 0 1
            specularColor 0 0 0 1
            emissionColor 0 0 0 1
            shininess 0
 From what I can tell from reading the OpenGL documentation and looking 
at the OSG code, this means it should ignore any per-vertex colors and 
just use the material settings, correct?  Does it still need a color array?

The normals looks fine:
        NormalBinding PER_VERTEX
        NormalArray Vec3Array 6
          0 0 1
          0 0 1
          0 0 1
          0 0 1
          0 0 1
          0 0 1

The original .ive file was produced using OSGExp with 3D Studio Max 2008 
(the plugin is still using OSG 1.2, though.)    I don't have much 
control over whether it outputs materials or per-vertex colors, unless I 
go and noodle around with the nodes in code after loading them.  I 
suppose I could modify a file by hand to see if it makes a difference.

Another thing I noticed is that all the icons go black just before the 
camera zooms far enough that the icons are too small to render -- 
although in that case, it isn't very noticeable because the icons are 
already only a few pixels across on screen.

Also, I forgot to mention in my previous email but I'm using Open Scene 
Graph 2.6.1.

- Peter

Robert Osfield wrote:
> Hi Peter,
> Irratic changes of lighting + colour of objects in the scene as your 
> move the camera is typically due missing normals or colour arrays on 
> the geometry in the scene that is behaving oddly, as these missing 
> arrays will mean that their settings will be inherited from geometries 
> that just happen to be rendered before them.  Have a look at the 
> problem geometry to see if that it have any normal or colour arrays, 
> and if they don't add them in.
> Robert.
> _____________________________________
> 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