Jump to content
  • Advertisement
Sign in to follow this  
dsr12

specular lighting example from the orange book

This topic is 3677 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 set up the multitexturing example from the orange book where it applies a texture of the earth and a gloss map to a sphere. My issue is with the spectral highlight. It looks great when viewing the earth with the sun behind the "camera" (viewing the day side of the planet). However, when I orbit the camera around to where the earth begins to eclipse the position of the light source the highlights seem to be unnatural because the light begins to highlight areas of the sphere well beyond where daylight ends. To explain it another way, the spectral highlight wraps past where light directly hits the sphere so that the specular component is non-zero where the diffuse component is zero. Even when the camera is completely behind the earth in line with the light source, the edges of the earth show slight highlighting from the specular component. Looking through the code, it makes sense to me that this should be happening, but it doesn't look right. Has anyone heard of the problem I described? I'll have some screen shots in about 15 min.

Share this post


Link to post
Share on other sites
Advertisement
The lighting here is all in the same direction which is given as the vector passing through the center of the sphere and that little white dot on the back surface of the sphere. The rose shaded region represents all areas of the sphere which do not receive any light (dot product between the light vector and surface normal is <= 0 with the light vector pointing to the source of light). I have blended the specular component into the rose color which is why the rose region does not have a clean line on its boundary. The specular highlight is apparent on the left side of the sphere and instead of fading out before it hits the edge of daylight, it extends past into the night region. The tiled dark pattern is the effect of the gloss map of the country India. I only have partly assembled images for the texturing so that is why I don't have the entire earth mapped on there. The daylight texture is just blue across the entire planet.


description of your image

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!