alecjacobson / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
14 stars 22 forks source link

Moon's Lighting Always facing the Planet #58

Open CalinArdelean opened 4 years ago

CalinArdelean commented 4 years ago

image

Why does the lighting of the moon always shine on the face which faces the planet as it rotates? [See picture] In lit.fs, I give the same light direction for both planets. It seems that the moon's lighting is coming from the planet (the origin). Where could be the problem?

abhimadan commented 4 years ago

It's more likely that the problem is with your normals than with your light direction. For example, keep in mind that snap_to_sphere.tes should output normals in camera space.