dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

Reflection adds additional colors onto the image #35

Open melissa-pan opened 4 years ago

melissa-pan commented 4 years ago

Hi,

My code generates additional color onto the image after adding reflection. The image without reflection looks the same with the reference image "ambient-diffuse-specular-shadows", so I am thinking that the issue might occur in the recursion or the reflection function. I checked these two functions (raycolor, reflection) but couldn't find any problem.

Screen Shot 2020-01-30 at 1 05 21 PM
dilevin commented 4 years ago

I don't know what the bug is ... but this is beautiful. If you can recreate this effect on purpose you should use it for the creative.json

Navash914 commented 4 years ago

Maybe you're not taking the material's km into account, so its adding more color than necessary? I do agree this is beautiful tho O.O

melissa-pan commented 4 years ago

Problem solved.

I added epsilon * normal for reflected ray origin and epsilon to reflected ray direction to avoid self-reflection initially. Removal of the epsilon solved the problem