@@ -360,9 +360,13 @@ public static boolean pathTrace(Scene scene, Ray ray, WorkerState state, int add
360
360
ray .color .y = (1 - gTrans ) * ray .color .y + gTrans ;
361
361
ray .color .z = (1 - bTrans ) * ray .color .z + bTrans ;
362
362
// Scale by results from refracted ray
363
+ ray .emittance .set (ray .color .x , ray .color .y , ray .color .z );
363
364
ray .color .x *= refracted .color .x ;
364
365
ray .color .y *= refracted .color .y ;
365
366
ray .color .z *= refracted .color .z ;
367
+ ray .emittance .x *= refracted .emittance .x ;
368
+ ray .emittance .y *= refracted .emittance .y ;
369
+ ray .emittance .z *= refracted .emittance .z ;
366
370
hit = true ;
367
371
}
368
372
}
@@ -393,9 +397,13 @@ public static boolean pathTrace(Scene scene, Ray ray, WorkerState state, int add
393
397
ray .color .y = (1 - gTrans ) * ray .color .y + gTrans ;
394
398
ray .color .z = (1 - bTrans ) * ray .color .z + bTrans ;
395
399
// Scale by results from transmitted ray
400
+ ray .emittance .set (ray .color .x , ray .color .y , ray .color .z );
396
401
ray .color .x *= transmitted .color .x ;
397
402
ray .color .y *= transmitted .color .y ;
398
403
ray .color .z *= transmitted .color .z ;
404
+ ray .emittance .x *= transmitted .emittance .x ;
405
+ ray .emittance .y *= transmitted .emittance .y ;
406
+ ray .emittance .z *= transmitted .emittance .z ;
399
407
hit = true ;
400
408
}
401
409
}
0 commit comments