Skip to content

Commit

Permalink
Fix shader precision problem
Browse files Browse the repository at this point in the history
- Changed to use max() instead of arithmetic addition to avoid a zero
  division. That addition seems to have no effect on some architectures
  because of a rounding erorr or aggressive optimization.
  • Loading branch information
Keijiro Takahashi authored and Keijiro Takahashi committed May 31, 2016
1 parent 070da24 commit e9340c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Kino/Bloom/Shader/Bloom.cginc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ half4 frag_prefilter(v2f_img i) : SV_Target
rq = _Curve.z * rq * rq;

// Combine and apply the brightness response curve.
m *= max(rq, br - _Threshold) / (br + 1e-5);
m *= max(rq, br - _Threshold) / max(br, 1e-5);

return EncodeHDR(m);
}
Expand Down

0 comments on commit e9340c4

Please sign in to comment.