Re: Lighting problem of Flight models

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 28 Oct 1998 15:43:35 -0800


On Oct 23, 1:16pm, Mario Veraart wrote:
>The effect that I see is that the Flight objects are drawn brighter or
>darker depending on the viewpoint, just a minute change in heading can
>cause a sudden lightening or darkening of the flight objects.
>When I disable the drawing of the terrain with a draw traversal mask
>then the effect does not happen.

Sounds like your objects have a pfGeoState that has incomplete lighting
specifications while the pfGeoSets have normals. Depending upon your viewpoint
the order of rendering causes different values to be latched by OpenGL. OpenGL
uses these "last" values to rendering vertices (polygons).

I bet that the flashing will change (or stop) if you turn off cull sorting too.

>The terrain is a textured mesh of triangles with color and normal
>attributes in the pfGeoSet. All terrain tiles use the same pfGeoState
>that is fully defined. The flight objects are non-textured and
>modelled with Gouraud shading.

This implies that they don't have normals. Now if you have disabled
PFFLT_COMPUTENORMALS this will in fact be true. So the pfGeoState used by the
objects, created by the loader, will leave PFSTATE_ENLIGHTING unspecified.

Hmmm ... along time ago the OpenFlight loader was changed for Performer 2.0
when pfGeoState modes were all PF_OFF by default. That has changed for 2.2 it
apears. The 2.2 man page says that all state elements are now inherited by
default.

Your application probably has called pfdMakeShared() as well, which complicates
matters a bit. Anyways, your application is ending up with a global state of
PFSTATE_ENLIGHTING == PF_ON and your unlit objects are being randomly lit.

As work around you can traverse the subgraph containing all your unlit geometry
and set each pfGeoState to PFSTATE_ENLIGHTING == PF_OFF.

I consider this a buglet in the OpenFlight loader and will be fixed in the next
release.

>When I look at the flight models with perfly they all look fine.

Perfly is setting up a different global state or it's computing normals for the
unlit geometry.

Regards.

--
+ Marcus Barnes, Technical Staff        mailto:marcus++at++multigen.com +
+ Multigen-Paradigm Inc.                http://www.multigen.com    +
+ 550 S. Winchester Blvd.               phoneto:1-408-367-2654     +
+ Suite 500 San Jose CA 95128           faxto:1-408-261-4103       +

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Oct 28 1998 - 15:43:56 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.