Re: GeoSets

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++rtset.co.il)
Fri, 18 Jul 1997 03:09:38 +0300


Peter Plachta wrote:

> Hi
>
> I have a slight problem with pfGeoSets - I change the colour of
> my pfGeoSet, enable lighting (I set PFSTATE_ENLIGHTING in a pfGeoState
>
> attached to the scene), attach a light to the scene & attach
> the GeoSet to the scene (through a pfGeode), but my set is not shaded.
> I
> compute the normals using cross product.
>

That could account for the flat shaded polygons in IrisGL - if every
polygon has one normal, or if each vertex of a polygon has the same
normal as others, you'll get flat shading. The shading color is computed
for each vertex according to its normal, and then interpolated along the
polygon. In the case of identical normals per polygon, the color will be
the same (unless using specularity), and so the interpolated color will
not vary. You could try to go over you geoset, find identical vertices
(shared by different polygons) and average their normal.

> When run on an Iris-GL, it always results in a white flat-shaded set.
>
> On an Open-GL, it's the right colour, but it is still flat-shaded.

Try setting pfMtlColorMode for the material your using, to
PFMTL_AMBIENT_AND_DIFFUSE. That way, your vertex colors will be used as
the ambient and diffuse factors of the material. In IrisGL, if a color
command was the last one sent to the pipe before the vertex, it will
override lighting calculations, unless otherwise specified by the
lmcolor() command (which is the equivalent of pfMtlColorMode ). If a
normal command was sent last, and unless otherwise specified by
lmcolor(), the color of the material will be used for shading instead of
the color specified by c4f, c3f etc.

Ran

 __ | Ran Yakir
 /_) _ __ \ / _ / o __ | 28 Ben Gurion St.
/ )_ (_(_) ) \/ (_(_/<_(_)( | Hod Hasharon 54200
              _/ | Israel
-------------------------------------+--------------------------------
At Home : | At Work :
| RT-SET
  Voice : +972-9-7489974 | Voice : +972-9-9552236
  Fax : +972-9-7422149 | Fax : +972-9-9552239
  E-mail : rany++at++netvision.net.il | E-mail : rany++at++rtset.co.il
http://rtset.co.il/rany

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:37 PDT

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