Skip to main content
GameDev.net gamedev.net
🔒 Locked

Spherical Normals

Started by FlyingDemon Sep 22, 2005 at 3:49 PM 4 replies 1.3k views
Original Post
FlyingDemon
FlyingDemon
I have a sphere and I'm wondering, since it's a sphere isn't the normal at a vertex just the normalized vertex position? If that’s true - would using that for smooth shading be better then using the averaged normals of the faces sharing that vertex?
Sages
Sages
In short: Yes. Yes.

Elaboration:
1) Yes, the normalized position of a sphere is it's normal.
2) Eh, it probably wouldn't matter. Theoretically, you're doing less processing and therefore your floats should lose less precision. There probably wouldn't be a noticeable difference in image quality.
JohnBolton
JohnBolton
If you know the true value of a normal, you should use that value rather than deriving a value from the shape of the mesh. After all, the mesh is only an approximation of the true shape.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
d000hg
d000hg
Plus you can probably do it faster. For a unit sphere, the position IS the normal (apart from translating by the position of the sphere's centre). If you know the radius then you can avoid nast sqrts and averaging etc...
Sages
Sages
Quote:
Original post by d000hg
Plus you can probably do it faster. For a unit sphere, the position IS the normal (apart from translating by the position of the sphere's centre). If you know the radius then you can avoid nast sqrts and averaging etc...

Just to clarify. d000hg is simply stating that instead of doing:

Vector3 normal = currentPointOnSphere - sphere.origin;
normal.Normalize();

You could do:

Vector3 normal = currentPointOnSphere - sphere.origin;
normal.Scale( 1 / sphere.radius );

The second method would be less computationally expensive.

And it works because the radius is the length of the calculated vector normal (before scales or normalizes). Hope this helps.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.