Skip to content

Commit

Permalink
update shader
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Zhixing committed Sep 6, 2021
1 parent 1b5718b commit 998683f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pipelined/bevy_pbr2/src/render/pbr.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fn reinhard(color: vec3<f32>) -> vec3<f32> {
}

fn reinhard_extended(color: vec3<f32>, max_white: f32) -> vec3<f32> {
let numerator = color * (1.0f + (color / vec3<f32>(max_white * max_white)));
let numerator = color * (1.0 + (color / vec3<f32>(max_white * max_white)));
return numerator / (1.0 + color);
}

Expand All @@ -311,14 +311,14 @@ fn change_luminance(c_in: vec3<f32>, l_out: f32) -> vec3<f32> {

fn reinhard_luminance(color: vec3<f32>) -> vec3<f32> {
let l_old = luminance(color);
let l_new = l_old / (1.0f + l_old);
let l_new = l_old / (1.0 + l_old);
return change_luminance(color, l_new);
}

fn reinhard_extended_luminance(color: vec3<f32>, max_white_l: f32) -> vec3<f32> {
let l_old = luminance(color);
let numerator = l_old * (1.0f + (l_old / (max_white_l * max_white_l)));
let l_new = numerator / (1.0f + l_old);
let numerator = l_old * (1.0 + (l_old / (max_white_l * max_white_l)));
let l_new = numerator / (1.0 + l_old);
return change_luminance(color, l_new);
}

Expand Down

0 comments on commit 998683f

Please sign in to comment.