ssloy / tinyraytracer

A brief computer graphics / rendering course
https://github.com/ssloy/tinyraytracer/wiki
5.04k stars 333 forks source link

Why the mirror don't reflect the sea? #23

Closed KnewHow closed 3 years ago

KnewHow commented 3 years ago

the picture link is: https://github.com/KnewHow/TinyRayTracer/blob/add_background/out.jpg

ssloy commented 3 years ago

Because you need to pick the color from the envmap here: https://github.com/KnewHow/TinyRayTracer/blob/6ef1a4f33ee572bd1e86e095e6bb6af91478ca64/renderer.cpp#L36

You use the initial ray to pick the color, and the final one is to be used.

KnewHow commented 3 years ago

Thank you very match, I have got it!