Skip to content

Commit 10a2144

Browse files
authored
WebGPURenderer: Explicitly set VideoTexture#colorSpace to SRGBColorSpace (#31534)
* fix * shorten * lint
1 parent 5588622 commit 10a2144

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

examples/webgpu_lights_projector.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
video.play();
192192

193193
videoTexture = new THREE.VideoTexture( video );
194+
videoTexture.colorSpace = THREE.SRGBColorSpace;
194195

195196
}
196197

examples/webgpu_materials_video.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
} );
9898

9999
texture = new THREE.VideoTexture( video );
100+
texture.colorSpace = THREE.SRGBColorSpace;
100101

101102
//
102103

src/textures/VideoTexture.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { Texture } from './Texture.js';
1010
* const texture = new THREE.VideoTexture( video );
1111
* ```
1212
*
13+
* Note: When using video textures with {@link WebGPURenderer}, {@link Texture#colorSpace} must be
14+
* set to THREE.SRGBColorSpace.
15+
*
1316
* Note: After the initial use of a texture, its dimensions, format, and type
1417
* cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.
1518
*

0 commit comments

Comments
 (0)