问题描述
我创建了一个示例来展示我所看到的:https://haddons.net/threejs/chrome_firefox.html
I've created a sample to show what I'm seeing: https://haddons.net/threejs/chrome_firefox.html
我有一个基本模型,可以将纹理加载到平面上,同时还可以获取一些高度图数据.如果我在 chrome 中加载它,纹理会朝向一个方向,如果我在 firefox 中加载它,它会旋转 180 度.
I have a basic model that's loading a texture onto a plane and also pulling in some heightmap data. If I load it in chrome the texture is oriented in one direction and if I load it in firefox it's rotated 180 degrees.
我做错了什么还是这是一个 firefox、chrome 或three.js 错误?
Am I doing something wrong or is this a firefox, chrome or three.js bug?
推荐答案
不幸的是,这是当前版本的 three.js
(R102
) 中的一个错误.此 PR 将在下一个版本中修复此问题.
Unfortunately, this is a bug in the current version of three.js
(R102
). It will be fixed with the next release by this PR.
问题在于,如果需要调整大小,纹理就会翻转.如果您尝试将 mipmapping 与 NPOT 纹理一起使用,则总是会发生这种情况.一种解决方法是像下面这样配置您的纹理,以使用 POT 纹理或 WebGL 2:
The problem was that textures were flipped if a resize was necessary. This always happens if you try to use mipmapping with a NPOT texture. A workaround is to configure your texture like the following, to use POT textures or WebGL 2:
texture.minFilter = THREE.LinearFilter;
这篇关于chrome 与 firefox 中 PlaneBufferGeometry 的不同方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!