GLTF:我的场景与三个编辑器之间的金属差异https://threejs.org/editor/
我有一个GLTF文件。当我将其导入三个.js编辑器( https://threejs.org/editor/ )i获取正确的结果当我添加环境图时。
另一方面,当我在项目场景中导入GLTF时,我会不同的结果 。即使我使用相同的HDRI图像。在这种情况下,金属度太耀眼了。
有人知道我缺少什么吗?谢谢。
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
renderer.outputEncoding = THREE.sRGBEncoding;
new RGBELoader()
.load( 'royal_esplanade_1k.hdr', function ( texture ) {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = texture;
} );
loader.load(
'./gltf/canette.glb',
// called when the resource is loaded
function ( gltf ) {
obj = gltf.scene;
mixer = new THREE.AnimationMixer( gltf.scene );
action = mixer.clipAction( gltf.animations[ 0 ] );
//obj
scene.add( obj );
}
);
编辑:
I've got a gltf file. When I import it inside the Three.js editor (https://threejs.org/editor/) I get a correct result when I add an environment map.
On the other hand, when I import my gltf in my project scene I've a different result. Even when I use the very same HDRI image. The metalness is way too shinny in this case.
Does anyone know what I'm missing? Thank you.
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
renderer.outputEncoding = THREE.sRGBEncoding;
new RGBELoader()
.load( 'royal_esplanade_1k.hdr', function ( texture ) {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = texture;
} );
loader.load(
'./gltf/canette.glb',
// called when the resource is loaded
function ( gltf ) {
obj = gltf.scene;
mixer = new THREE.AnimationMixer( gltf.scene );
action = mixer.clipAction( gltf.animations[ 0 ] );
//obj
scene.add( obj );
}
);
EDIT :
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,您使用的是与实际
three.js
版本不匹配的代码段。您必须至少使用r131
(或者更好的是最新的r141
)。现在,您正在使用R129
。如果您使用
three.js
r131
的版本,则必须使用pmRemgenerator
来准备适用于PBR材料的环境图。从R131
开始,引擎正在为您执行此操作,因此您不必担心PMRemganerator
。Unfortunately, you are using a code snippet which does not match your actual
three.js
version. You have to use at leastr131
(or better the latest oner141
). Right now, you are usingr129
.If you use
three.js
versions belowr131
, you have to usePMREMGenerator
to prepare the environment map that you apply to PBR materials. Starting fromr131
, the engine is doing this for you so you don't have to worry aboutPMREMGenerator
at all.