Skip to content

Commit

Permalink
Src: Ensure tone mapped value is in-range (#26130)
Browse files Browse the repository at this point in the history
* Clamp returned value

* Clamp returned value
  • Loading branch information
WestLangley authored May 25, 2023
1 parent b5c3f51 commit f65f05c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/jsm/nodes/display/ToneMappingNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { NoToneMapping, LinearToneMapping, ReinhardToneMapping, CineonToneMappin
// exposure only
const LinearToneMappingNode = new ShaderNode( ( { color, exposure } ) => {

return color.mul( exposure );
return color.mul( exposure ).clamp();

} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ uniform float toneMappingExposure;
// exposure only
vec3 LinearToneMapping( vec3 color ) {
return toneMappingExposure * color;
return saturate( toneMappingExposure * color );
}
Expand Down

0 comments on commit f65f05c

Please sign in to comment.