【问题标题】:ThreeJS videoTexture linear workflowThreeJS videoTexture 线性工作流程
【发布时间】: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


【解决方案1】:

所以基本上我的代码是正确的。我必须删除浏览器缓存才能看到这些更改。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多