Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

edwinnie

lightmap seams

This topic is 5479 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

ok! i managed to get lightmap working slightly fine for the sphere and cylinder... now one problem: there were "seams", so how to get rid of them?? the pic where the cylinder and sphere show seams: problempic need some advice... Edwinz

Share this post


Link to post
Share on other sites
Advertisement
How exactly are you calculating the light maps? If you''re doing it per face using face normals, then you''ll have this kind of result. Maybe use vertex normals instead of face normals when computing cylinder lightmaps, and make those vertex normals radial?

Share this post


Link to post
Share on other sites
hmm... i am using face normals...
hmm... how do u actualli make the vertex normal radial?
is there a math forumla to it??

thx fer replying
Edwinz

Share this post


Link to post
Share on other sites
quote:
hmm... how do u actualli make the vertex normal radial?
is there a math forumla to it??

Sure there is. You have the points for the vertices (x,y,z) right?

So the normal, call it N is a vector pointing from your vertex V to the center of the sphere C.


_ _ _
In vector notation, N = V - C

Which translates to...

Nx = Vx - Cx
Ny = Vy - Cy
Nz = Vz - Cz

Then you just need to normalize N (scale it down so its length is equal to 1.0, without changing its direction). All you do is divide N by its length:


N = N / |N| which really means...


Nx = Nx / sqrt( Nx^2 + Ny^2 + Nz^2 )
Ny = Ny / sqrt( Nx^2 + Ny^2 + Nz^2 )
Nz = Nz / sqrt( Nx^2 + Ny^2 + Nz^2 )


Realize that I said V - C. It could be the other way around depending on your coordinate system. If your normals are all pointing the wrong direction (inward instead of outward), swap the V and the C in the above equations.



[edited by - bob_the_third on August 19, 2003 2:45:16 AM]

Share this post


Link to post
Share on other sites

  • 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!