dilevin / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
2 stars 5 forks source link

Question about Moon Lighting #51

Closed hugoksp closed 11 months ago

hugoksp commented 11 months ago

I have implemented my snap to sphere and blinn-phong for the planets but the lighting on the moon does not correspond to the lightning on the planet. I am currently using normal coloring as described in the debug methods and this is what I am seeing. I would like to ask, in the correct, scenario, what should the moon look like for these positions, should the moon always have the same blue and pink color from this angle? Or am I looking at the wrong place and the normal isn't the problem?

image image

wenzhi-guo commented 11 months ago

I'm assuming you are calling ./shaderpipeline ../data/test-05.json with the debugging code for the normal (i.e. setting the color to 0.5+0.5*n). The color of the moon shouldn't change by this much as it rotates around the planet.

hugoksp commented 11 months ago

Is it supposed to look the same on the second image? If I understand correctly shouldn’t the normal always look the same if we don’t move the camera? I am a bit confused on the supposed behavior.

wenzhi-guo commented 11 months ago

In the second image, the moon should appear as similar color as the planet in this debugging mode.

hugoksp commented 11 months ago

I found the issue, I calculated my normal incorrectly without taking into consideration the center of the moon. Thanks for the help!