渲染后更改各向异性不起作用
Changing anisotropy after render do not work
我在更新 THREE
版本 137 以上时遇到问题 - 如果我在对象渲染后更改 anisotropy
,它会破坏对象上的 material。
例如,让我们使用 three.js 个示例 webgl_loader_texture_tga.html
。现在让我们添加到 init()
:
scene.background = new THREE.Color()
window.setTimeout( () => {
mesh2.material.map.anisotropy = 16;
mesh2.material.map.needsUpdate = true;
}, 1000 );
超时运行后,对象变为黑色,我们在控制台收到以下警告:
[.WebGL-00005420002AC600] GL_INVALID_OPERATION: Level of detail outside of range.
[.WebGL-00005420002AC600] GL_INVALID_OPERATION: Texture format does not support mipmap generation.
编辑:
现场示例可在此处找到:https://codepen.io/kajbo/pen/mdpwybO
请注意,如果您将 THREE
版本更改为 137 或更低版本,一切都会按预期运行。
这实际上是 three.js
中的错误。我已经在 GitHub 提交了 PR 来解决这个问题:https://github.com/mrdoob/three.js/pull/23808
我在更新 THREE
版本 137 以上时遇到问题 - 如果我在对象渲染后更改 anisotropy
,它会破坏对象上的 material。
例如,让我们使用 three.js 个示例 webgl_loader_texture_tga.html
。现在让我们添加到 init()
:
scene.background = new THREE.Color()
window.setTimeout( () => {
mesh2.material.map.anisotropy = 16;
mesh2.material.map.needsUpdate = true;
}, 1000 );
超时运行后,对象变为黑色,我们在控制台收到以下警告:
[.WebGL-00005420002AC600] GL_INVALID_OPERATION: Level of detail outside of range.
[.WebGL-00005420002AC600] GL_INVALID_OPERATION: Texture format does not support mipmap generation.
编辑:
现场示例可在此处找到:https://codepen.io/kajbo/pen/mdpwybO
请注意,如果您将 THREE
版本更改为 137 或更低版本,一切都会按预期运行。
这实际上是 three.js
中的错误。我已经在 GitHub 提交了 PR 来解决这个问题:https://github.com/mrdoob/three.js/pull/23808