【发布时间】:2021-07-16 17:13:39
【问题描述】:
我在我的 R3F 应用程序中使用了三个 VideoTexture。不幸的是,它没有经过伽马校正,所以我的视频似乎被淘汰了。我尝试将我的纹理的编码设置为 sRGBEncoding,但这似乎没有任何作用。在 videotexture 的三个文档中也没有关于编码的内容。
如何在 VideoTextures 上设置 RGBEncoding?
提前致谢。
这是我的纹理:
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,
});
【问题讨论】:
-
VideoTexture从其Texture基类继承编码属性。因此,您应该能够通过为相应的encoding属性分配值来设置编码。顺便说一句:你的视频纹理使用什么材料? -
我编辑了我的帖子并添加了我的代码。我正在使用 MeshStandardMaterial。
标签: three.js webgl react-three-fiber