如何使用 INVALID_OPERATION 修复三个 JS 中的错误:texImage3D [已关闭]

问题描述 投票:0回答:0

我有这样的代码

this.someTexture = new THREE.TextureLoader().load("somepath");

但我在每次渲染时都会遇到此错误:WebGL: INVALID_OPERATION: texImage3D: FLIP_Y or PREMULTIPLY_ALPHA is not allowed for uploading 3D textures

我尝试使用其他选项来加载图像,但这对我没有帮助。也许我做错了什么

constructor() {
  this.redTexture = new THREE.TextureLoader().load("somepath");
}
init() {
  this.scene.someMaterials.red = new THREE.MeshBasicMaterial({
      map: this.redTexture,
      transparent: true,
 });
}
javascript reactjs three.js webgl
© www.soinside.com 2019 - 2024. All rights reserved.