We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98d5b7e commit 5119568Copy full SHA for 5119568
src/302_raytracer/camera.h
@@ -316,6 +316,10 @@ class Camera
316
Ray scattered;
317
Color attenuation;
318
319
+ if (Constant* c = dynamic_cast<Constant*>(rec.mat_ptr.get())) {
320
+ return c->albedo;
321
+ }
322
+
323
if (rec.mat_ptr->scatter(r, rec, attenuation, scattered))
324
{
325
// For constant materials, the scattered ray direction is zero, so we just return the attenuation
0 commit comments