将绘制的模型从 Blender 导出到 Three.js
我尝试将 GLTF 模型从 Blender 导出到 Three.js。有用。但我在 Three.js 上有一些带有照明和绘画的工件。我在 Three.js 中有线条和正方形,但我不知道为什么。
我只使用 Blender 中的 Principled BSDF 节点来绘制我的模型。如果我在 Three.js (MeshPhongMaterial) 中设置材质,它就可以正常工作。但对于来自 Blender 的 Principled BSDF 节点则不然。有什么想法吗?
我试图让物体投射阴影并对灯光做出反应。这与 MeshPhongMaterial 和 Principled BSDF 配合良好。但在第二种选择中,我不喜欢这些黑色条纹。
const INITIAL_MTL = new THREE.MeshPhongMaterial( { color: 0x575757, shininess: 10 } );
...
let theModel = gltf.scene;
theModel.traverse((o) => {
if (o.isMesh) {
if (o.name == 'Foundation') {
o.material = INITIAL_MTL //Left part on screenshot with MeshPhongMaterial
}
o.castShadow = true;
o.receiveShadow = true;
}
})
I tried to export GLTF model from Blender to Three.js. It works. But I have some artifacts on Three.js with lighting and painting. I have lines and squares in Three.js and I don't know why.
I used only Principled BSDF node in Blender to painting my model. If I set material in Three.js (MeshPhongMaterial) it works fine. But not with Principled BSDF node from Blender. Any ideas?
I'm trying to make the object cast a shadow and react to the lighting. This works well with MeshPhongMaterial and with Principled BSDF. But in the second option, I don't like these black stripes.
const INITIAL_MTL = new THREE.MeshPhongMaterial( { color: 0x575757, shininess: 10 } );
...
let theModel = gltf.scene;
theModel.traverse((o) => {
if (o.isMesh) {
if (o.name == 'Foundation') {
o.material = INITIAL_MTL //Left part on screenshot with MeshPhongMaterial
}
o.castShadow = true;
o.receiveShadow = true;
}
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
减轻自阴影伪影的常用方法是调制阴影投射光的
bias
属性。尝试一下:The usual approach to mitigate self-shadowing artifacts is to modulate the
bias
property of your shadow-casting light. Try it with: