Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nodes/TSL.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export * from './accessors/VelocityNode.js';
export * from './display/BlendMode.js';
export { default as BumpMapNode, bumpMap } from './display/BumpMapNode.js';
export * from './display/ColorAdjustment.js';
export { default as ColorSpaceNode, linearSRGBToColorSpace, colorSpaceToLinearSRGB } from './display/ColorSpaceNode.js';
export { default as ColorSpaceNode, toOutputColorSpace, toWorkingColorSpace } from './display/ColorSpaceNode.js';
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
export { default as NormalMapNode, normalMap } from './display/NormalMapNode.js';
export { default as PosterizeNode, posterize } from './display/PosterizeNode.js';
Expand Down
6 changes: 3 additions & 3 deletions src/nodes/accessors/TextureNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { registerNode } from '../core/Node.js';
import UniformNode, { uniform } from '../core/UniformNode.js';
import { uv } from './UV.js';
import { textureSize } from './TextureSizeNode.js';
import { colorSpaceToLinearSRGB } from '../display/ColorSpaceNode.js';
import { toWorkingColorSpace } from '../display/ColorSpaceNode.js';
import { expression } from '../code/ExpressionNode.js';
import { maxMipLevel } from '../utils/MaxMipLevelNode.js';
import { nodeProxy, vec3, nodeObject } from '../tsl/TSLBase.js';
Expand Down Expand Up @@ -274,9 +274,9 @@ class TextureNode extends UniformNode {
let snippet = propertyName;
const nodeType = this.getNodeType( builder );

if ( builder.needsColorSpaceToLinearSRGB( texture ) ) {
if ( builder.needsToWorkingColorSpace( texture ) ) {

snippet = colorSpaceToLinearSRGB( expression( snippet, nodeType ), texture.colorSpace ).setup( builder ).build( builder, nodeType );
snippet = toWorkingColorSpace( expression( snippet, nodeType ), texture.colorSpace ).setup( builder ).build( builder, nodeType );

}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ class NodeBuilder {

}

needsColorSpaceToLinearSRGB( /*texture*/ ) {
needsToWorkingColorSpace( /*texture*/ ) {

return false;

Expand Down
8 changes: 4 additions & 4 deletions src/nodes/display/ColorSpaceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export default ColorSpaceNode;

ColorSpaceNode.type = /*@__PURE__*/ registerNode( 'ColorSpace', ColorSpaceNode );

export const linearSRGBToColorSpace = ( node, colorSpace = null ) => nodeObject( new ColorSpaceNode( nodeObject( node ), colorSpace, LinearSRGBColorSpace ) );
export const colorSpaceToLinearSRGB = ( node, colorSpace = null ) => nodeObject( new ColorSpaceNode( nodeObject( node ), LinearSRGBColorSpace, colorSpace ) );
export const toOutputColorSpace = ( node, colorSpace = null ) => nodeObject( new ColorSpaceNode( nodeObject( node ), colorSpace, LinearSRGBColorSpace ) );
export const toWorkingColorSpace = ( node, colorSpace = null ) => nodeObject( new ColorSpaceNode( nodeObject( node ), LinearSRGBColorSpace, colorSpace ) );

addMethodChaining( 'linearSRGBToColorSpace', linearSRGBToColorSpace );
addMethodChaining( 'colorSpaceToLinearSRGB', colorSpaceToLinearSRGB );
addMethodChaining( 'toOutputColorSpace', toOutputColorSpace );
addMethodChaining( 'toWorkingColorSpace', toWorkingColorSpace );
2 changes: 1 addition & 1 deletion src/nodes/display/RenderOutputNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RenderOutputNode extends TempNode {

if ( outputColorSpace === SRGBColorSpace ) {

outputNode = outputNode.linearSRGBToColorSpace( outputColorSpace );
outputNode = outputNode.toOutputColorSpace( outputColorSpace );

}

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgpu/nodes/WGSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class WGSLNodeBuilder extends NodeBuilder {

}

needsColorSpaceToLinearSRGB( texture ) {
needsToWorkingColorSpace( texture ) {

return texture.isVideoTexture === true && texture.colorSpace !== NoColorSpace;

Expand Down