Jump to content
  • Advertisement
Sign in to follow this  
FlyingDemon

Spherical Normals

This topic is 4744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!