Skip to content

Commit

Permalink
ToneMappingNode: Properly handle alpha (#29076)
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley authored Aug 8, 2024
1 parent 03419b8 commit 3e8a4f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nodes/display/ToneMappingNode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import TempNode from '../core/TempNode.js';
import { addNodeClass } from '../core/Node.js';
import { addNodeElement, Fn, nodeObject, float, mat3, vec3, If } from '../shadernode/ShaderNode.js';
import { addNodeElement, Fn, nodeObject, float, mat3, vec3, vec4, If } from '../shadernode/ShaderNode.js';
import { rendererReference } from '../accessors/RendererReferenceNode.js';
import { select } from '../math/CondNode.js';
import { clamp, log2, max, min, pow, mix } from '../math/MathNode.js';
Expand Down Expand Up @@ -194,14 +194,14 @@ class ToneMappingNode extends TempNode {

if ( toneMapping === NoToneMapping ) return colorNode;

const toneMappingParams = { exposure: this.exposureNode, color: colorNode };
const toneMappingParams = { exposure: this.exposureNode, color: colorNode.rgb };
const toneMappingNode = toneMappingLib[ toneMapping ];

let outputNode = null;

if ( toneMappingNode ) {

outputNode = toneMappingNode( toneMappingParams );
outputNode = vec4( toneMappingNode( toneMappingParams ), colorNode.a );

} else {

Expand Down

0 comments on commit 3e8a4f5

Please sign in to comment.