Skip to main content
gamedev.net
🔒 Locked

Solar System

Started by Niall18 0 replies 600+ views
Original Post
Niall18
Niall18
Hey guys i'm creating a solar system and at the moment i have a sun, earth and moon all positioned and rotating properly. I added a positional light into the scene and i seem to be getting some odd results. For example if i stop everything moving and line the sun eath and moon up on the right hand side for an eclipse effect then place the light on the left hand side rather than the sun blocking out the light hitting the planets it still lights them up. So i get the left hand side of the sun lit which is fine but also get the left hand side of the earth and moon lit up. I get the same messed up results when all the planets are moving and rotating, the bits that are supposed to be in shadow aren't. Its like the light isn't taking into account the other spheres exist. Help??
Enigma
Enigma
OpenGL's lighting model does not take into account occlusion. It can't since objects may be rendered before their occluders are rendered. You need to look into some form of shadow casting algorithm. Shadow Mapping and Shadow Volumes are popular shadowing algorithms.

Enigma

Topic Locked

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

Sign in to reply to this topic.