Skip to content

Commit

Permalink
bounce visualization
Browse files Browse the repository at this point in the history
Signed-off-by: Devashish Lal <[email protected]>
  • Loading branch information
BLaZeKiLL committed Jun 24, 2024
1 parent 8107b82 commit 85802ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webray/src/shaders/webray.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ fn render_ray(ray: Ray) -> vec3f {

var accumulated_color = (1.0 - alpha) * vec3f(1.0) + alpha * vec3f(0.3, 0.6, 1.0);

return ERR_COLOR; // early return for testing

var bounce = 0u;

// try world hits
Expand All @@ -390,6 +388,9 @@ fn render_ray(ray: Ray) -> vec3f {
}
}

// number of bounce visualization
accumulated_color = vec3f(1.0, 1.0, 1.0) / f32(bounce + 1);

// max bounce condition
if bounce >= config.image.bounces {
accumulated_color = vec3f(0.0, 0.0, 0.0);
Expand Down

0 comments on commit 85802ae

Please sign in to comment.