Re: pfSCS and normals

New Message Reply Date view Thread view Subject view Author view

Don Hatch (hatch++at++hell.engr.sgi.com)
Tue, 14 Apr 1998 16:39:34 -0700


On Apr 14, 2:25pm, Javier Abadia Miranda wrote:
> Subject: pfSCS and normals
> Hello:
>
> How do pfSCS (scaling) affect normals ?
>
> I have been doing some tests and I have found that Normals suffer
> the same transformation than Vertices. This leads to incorrect
> illumination when using a non-uniform scaling matrix.
>
> Is there a way to apply one scaling matrix to vertices and
> another to normals ?
>
> Any suggestions to solve this inconvenience?

OpenGL properly transforms the normals by the transpose
of the inverse of the matrix used for the vertices.
I think the issue is whether glEnable(GL_NORMALIZE) is called--
if not, the intensity of the lighting will be scaled wrongly
(this is true even for uniform scaling).

What version of Performer are you using?
Performer 2.2 properly tracks non-unit scales
in the scene graph and enables or disables GL_NORMALIZE appropriately.

Performer 2.0 had GL_NORMALIZE enabled all the time
(with a performance penalty).
I think Performer 2.1 never enabled it, but I'm not sure.

>
> Perhaps manual rescaling (i.e. multiplying each vertex
> by a Matrix, and its Normal by another) during load phase?
>
> I want to speed object loading up, because I am doing dynamic
> database management.

Yes, you could do that... multiply the normals by
the transpose of the inverse of the SCS matrix, and then renormalize the
resulting vectors to unit length.
Avoiding scales in the scene graph lets OpenGL go in a faster mode
(more precisely, it allows Performer to glDisable(GL_NORMALIZE)).

Don

-- 
Don Hatch  hatch++at++sgi.com  (415) 933-5150  Silicon Graphics, Inc.
=======================================================================
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:57:14 PDT

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