dilevin / computer-graphics-ray-tracing

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

Missing Light #80

Closed grandrx10 closed 1 day ago

grandrx10 commented 3 days ago

I seem to be having an issue with missing lights in my image:

image

Solution:

image

Also, when I run my code on mirror.json, I get a completely black image because none of the lights are hitting any objects.

image

"I was launched" prints out, but "I hit something" doesn't return for the mirror.json. As for the ./raytracing, only 1 light seems to be printing contact. I'm a little stumped because first_hit worked perfectly for the previous assignment, and now it seems to have hard time registering hits! What could be the cause of these missing lights?

grandrx10 commented 3 days ago

I'm going to need more clarification than a bit.ly link and unverified download.

dilevin commented 2 days ago

Please don’t download this link as it’s unverified and not officially vetted by any of us on the teaching side

Edit: deleted offending post with link

rsrinivasan1 commented 2 days ago

Having the same issue, I only see reflections from one light

EDIT: resolved, when you call first_hit in blinn_phong_shading, make sure to check if you actually hit an object before checking whether it's in front of the light!

grandrx10 commented 2 days ago

Ah, I was calculating my directional light, so it is fixed now. However, my mirror and sphere packing are still completely black because the viewing rays miss everything! Why is that? Could something be wrong with my first_hit() function? Or was I perhaps supposed to change it a little from the last assignment?

Btw, rsrinivasan1, I'm glad you figured out your issue! (my problem is within raycolor though.)

And additionally, thank you for deleting that suspicious post.

Anesthez commented 1 day ago

I also have the problem of missing light. What is the possible cause of it? Is it the problem of directional light.

grandrx10 commented 1 day ago

Ah if you are having a missing light in raytracing, it is because you wrote the directional light in the opposite direction. Read the header file to get a better sense of how to implement it.

However, my issue is not with the directional light unfortunately... I hope you figure yours out!

grandrx10 commented 1 day ago

Ah, problem solved! I was inserting the input data incorrectly, apologies. Good luck with your assignments.