Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment 2 - Solution #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abendo
Copy link

@abendo abendo commented Oct 15, 2020

No description provided.

@@ -68,6 +72,10 @@ class CScene
bool intersect(Ray& ray) const
{
// --- PUT YOUR CODE HERE ---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is implemented wrong. You return the first found intersection, instead of checking all possible intersections.

@@ -87,7 +99,8 @@ class CScene
Vec3f RayTrace(Ray& ray) const
{
// --- PUT YOUR CODE HERE ---
return Vec3f();
if(intersect(ray)) { return ray.hit->getShader()->shade(ray); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getShader() method throws an error because you do not fill ray.hit in your interestion algorithms.

for(auto light : m_scene.getLights()) {
for(int i = 0; i < n; i ++) {
if(!light->illuminate(shade))
if(m_scene.occluded(shade))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow the shadows are not rendered at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants