奇怪的凹凸贴图和不适用于Three.js的灯光贴图
我试图在基于奇怪的凹凸贴图和不适用于Three.js的灯光贴图,three.js,Three.js,我试图在基于Three.js的项目中使用一个临时太空船模型。此模型具有颜色、凹凸、镜面反射和灯光贴图 因此,我的问题是: 凹凸贴图看起来很奇怪/错误。你可以检查结果。 船上的凹槽似乎太深了,而在船的底部,凹槽太亮了 我做错了什么?我正在使用SceneLoader创建对象,加载.obj文件和纹理。下面是JSON文件的一些片段 对象: "ship" : { "type": "obj", "url" : "res/object/ship/space_frigate_6.obj",
Three.js
的项目中使用一个临时太空船模型。此模型具有颜色、凹凸、镜面反射和灯光贴图
因此,我的问题是:
- 凹凸贴图看起来很奇怪/错误。你可以检查结果。 船上的凹槽似乎太深了,而在船的底部,凹槽太亮了
SceneLoader
创建对象,加载.obj
文件和纹理。下面是JSON文件的一些片段
对象:
"ship" : {
"type": "obj",
"url" : "res/object/ship/space_frigate_6.obj",
"material": "ship",
"position": [0, 0, 0],
"rotation": [0, 4.71, 0],
"scale": [0.08, 0.08, 0.08],
"visible": true
}
"ship": {
"type": "MeshPhongMaterial",
"parameters": {
"map": "ship_color",
"bumpMap": "ship_bump",
"specularMap": "ship_specular",
"bumpMap": "ship_bump",
"bumpScale": 1
}
}
"ship_color": {
"url": "res/texture/ship/space_frigate_6_color.jpg",
"anisotropy": 4
},
"ship_bump": {
"url": "res/texture/ship/space_frigate_6_bump.jpg",
"anisotropy": 4
},
"ship_specular": {
"url": "res/texture/ship/space_frigate_6_specular.jpg",
"anisotropy": 4
}
材料:
"ship" : {
"type": "obj",
"url" : "res/object/ship/space_frigate_6.obj",
"material": "ship",
"position": [0, 0, 0],
"rotation": [0, 4.71, 0],
"scale": [0.08, 0.08, 0.08],
"visible": true
}
"ship": {
"type": "MeshPhongMaterial",
"parameters": {
"map": "ship_color",
"bumpMap": "ship_bump",
"specularMap": "ship_specular",
"bumpMap": "ship_bump",
"bumpScale": 1
}
}
"ship_color": {
"url": "res/texture/ship/space_frigate_6_color.jpg",
"anisotropy": 4
},
"ship_bump": {
"url": "res/texture/ship/space_frigate_6_bump.jpg",
"anisotropy": 4
},
"ship_specular": {
"url": "res/texture/ship/space_frigate_6_specular.jpg",
"anisotropy": 4
}
纹理:
"ship" : {
"type": "obj",
"url" : "res/object/ship/space_frigate_6.obj",
"material": "ship",
"position": [0, 0, 0],
"rotation": [0, 4.71, 0],
"scale": [0.08, 0.08, 0.08],
"visible": true
}
"ship": {
"type": "MeshPhongMaterial",
"parameters": {
"map": "ship_color",
"bumpMap": "ship_bump",
"specularMap": "ship_specular",
"bumpMap": "ship_bump",
"bumpScale": 1
}
}
"ship_color": {
"url": "res/texture/ship/space_frigate_6_color.jpg",
"anisotropy": 4
},
"ship_bump": {
"url": "res/texture/ship/space_frigate_6_bump.jpg",
"anisotropy": 4
},
"ship_specular": {
"url": "res/texture/ship/space_frigate_6_specular.jpg",
"anisotropy": 4
}
这是纹理的问题还是我做错了什么
- 灯光贴图不起作用:
GL\u无效\u操作
,但还好,我找到了解决方案。我尝试过,将其放入代码“obj.children[0].geometry.faceVertexUvs[1]=obj.children[0].geometry.faceVertexUvs[0]',但没有成功。屏幕上只有一艘黑色飞船
光照贴图工作需要做什么
您可以在以下位置查看我的项目:
谢谢。请在每篇文章中只讨论一个主题或一个问题。如果您有多个问题,请为每个问题创建单独的帖子。关于凹凸贴图问题,您是否尝试过调整
bumpScale
?尝试较低的值,例如0。1@yaku工作!似乎bumpScale
需要与网格比例的值相同,对吗?