Parcourir la source

WebGPURenderer: Video fix wrong colorSpace in WebGL Backend (#29254)

Renaud Rohlinger il y a 1 an
Parent
commit
2b74466d54
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js

+ 7 - 1
src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js

@@ -5,7 +5,7 @@ import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js';
 
 
 import { NodeSampledTexture, NodeSampledCubeTexture, NodeSampledTexture3D } from '../../common/nodes/NodeSampledTexture.js';
 import { NodeSampledTexture, NodeSampledCubeTexture, NodeSampledTexture3D } from '../../common/nodes/NodeSampledTexture.js';
 
 
-import { ByteType, ShortType, RGBAIntegerFormat, RGBIntegerFormat, RedIntegerFormat, RGIntegerFormat, UnsignedByteType, UnsignedIntType, UnsignedShortType, RedFormat, RGFormat, IntType, RGBFormat, RGBAFormat, FloatType } from '../../../constants.js';
+import { NoColorSpace, ByteType, ShortType, RGBAIntegerFormat, RGBIntegerFormat, RedIntegerFormat, RGIntegerFormat, UnsignedByteType, UnsignedIntType, UnsignedShortType, RedFormat, RGFormat, IntType, RGBFormat, RGBAFormat, FloatType } from '../../../constants.js';
 import { DataTexture } from '../../../textures/DataTexture.js';
 import { DataTexture } from '../../../textures/DataTexture.js';
 
 
 const glslMethods = {
 const glslMethods = {
@@ -62,6 +62,12 @@ class GLSLNodeBuilder extends NodeBuilder {
 
 
 	}
 	}
 
 
+	needsColorSpaceToLinearSRGB( texture ) {
+
+		return texture.isVideoTexture === true && texture.colorSpace !== NoColorSpace;
+
+	}
+
 	getMethod( method ) {
 	getMethod( method ) {
 
 
 		return glslMethods[ method ] || method;
 		return glslMethods[ method ] || method;

粤ICP备19079148号