Skip to content

Commit

Permalink
background shader working (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelrahim-hentabli authored Jan 25, 2024
1 parent e836d84 commit 9017046
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/render_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ vec3 Render_World::Cast_Ray(const Ray& ray,int recursion_depth)
vec3 point = ray.endpoint + closest.dist * ray.direction;
return closest.object->material_shader->Shade_Surface(ray, point, closest.object->Normal(point, closest.part), recursion_depth);
}
return color;
else{
return background_shader->Shade_Surface(ray, {0,0,0}, -ray.direction, recursion_depth);
}
}

void Render_World::Initialize_Hierarchy()
Expand Down

0 comments on commit 9017046

Please sign in to comment.