0

I'm using a three VideoTexture in my R3F App. Unfortunatly its not gamma corrected so my video seems washed out. I tried setting the encoding to sRGBEncoding for my texture, but that doesn't seem to do anything. Also there is nothing about encoding in the three docs of videotexture.

How can i set RGBEncoding on VideoTextures?

thanks in advance.

Here is my texture:

import {
  MeshStandardMaterial,
  VideoTexture,
  sRGBEncoding,
} from "three";

const textureVid = document.createElement("video");
textureVid.src = "assets/video/test.mp4";
textureVid.play();

const videoTexture = new VideoTexture(textureVid);
videoTexture.encoding = sRGBEncoding;

const matTVScreen = new MeshStandardMaterial({
  color: 0x000000,
  map: videoTexture,
});
tinytree
  • 1,009
  • 2
  • 12
  • 28
  • `VideoTexture` inherits the encoding property from its `Texture` base class. So you should be able to set an encoding by assigning a value to the respective `encoding` property. BTW: What material are you using with your video texture? – Mugen87 Apr 22 '21 at 14:23
  • I edited my post and added my code. I'm using a MeshStandardMaterial. – tinytree Apr 22 '21 at 15:22

1 Answers1

0

So basically my code was right. I had to delete my Browser cache to see these changes.

tinytree
  • 1,009
  • 2
  • 12
  • 28