Three.js dae 模型是黑色或深色
这是我的代码:
http://jsfiddle.net/zsitro/gYhrY/ (只是为了展示。 ..在小提琴上不起作用)
它可以加载: - THREE.js 内置平面和立方体以及灯光.. - 模型(1 个立方体和一个行走的生物)。
一切都好,但问题是这个生物几乎是黑色的(太黑了),而立方体是全黑的。如果我去掉灯光,它就会显示出它的纹理,并且怪物会更亮一点。
我找不到资源如何避免这种黑色的东西并使我的聚光灯发挥作用。
我认为聚光灯设置正确,因为下部立方体和轴线显示得很好(并按预期投射阴影)。
如果我切换光线方向 ->除了红色立方体再次按预期投射阴影之外,没有任何变化......
任何人都可以帮忙吗?
heres my code:
http://jsfiddle.net/zsitro/gYhrY/ (just to show... doesnt works at fiddle)
It can load:
- THREE.js inbuilt plane and cube and a light..
- the models (1 cube and a walking creature).
Its all ok, but the problem is the creature is almost black (soo dark), and the cube is total black. If I remove the light, it shows its texture and the monster is brighter a bit.
I cannot find resources how to avoid this black thing and make my spotlight work.
The spotlight is set up properly I think, because the lower cube and the axis lines are shown well (and cast shadow as expected).
If I switch the light direction -> nothing changes except the red cube casts shadow as expected again...
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用什么样的材料?弄清楚这一点,然后查看内部结构并修改受光照影响的一些属性。
一些好的起点
是 X 类型的材料。调整环境会提高基础亮度。
好的,我看到它是 MeshBasicMaterial。我会尝试将其更改为 phong 或 lambert 材质,并将环境值设置为大于默认值。
What kind of material is being applied? Figure that out and then look at the internals and modify some of the properties effected by lighting.
Some good places to start are
where this is a material of X type. Adjusting the ambient will bring the base brightness up.
Ok I see it's MeshBasicMaterial. I would try changing it to a phong or lambert material and setting the ambient value to greater than the default.
看看你的小提琴,我认为主要问题是你观看的角度,以及你有聚光灯但没有环境光的事实。尝试按如下方式添加环境光,看看这是否有帮助:
首先,您没有在聚光灯上设置浅色,因此它只是刺眼的白色,因此您需要执行以下操作,这会对您有所帮助:
如果仍然太暗,请尝试以下操作:
一旦找到正确的平衡,您就会被设置:)只需记住您的环境光是用 0xrrggbb 以十六进制设置的,所以如果您想将颜色中的所有内容切成两半,您使用020202,但如果你想要更多的蓝色,你可以使用 020204,例如,只要记住你正在使用的环境光,并且很容易使场景中的光过度饱和,所以保持较低的值,我通常会留下来。 2 * 我的点光源或定向光源(例如阳光、灯等)
让我知道这是否有帮助:)
looking at your fiddle, i think the main problem is the angle you are viewing from, and the fact that you have a spotlight, but no ambient light. try adding ambient light as follows and see if this helps some:
first, you are not setting a light color on your spotlight, so it's just harsh white, so you'll want to do something as follows, and this will help you:
if that is still too dark, try something like:
once you find the right balance, you'll be set :) just remember that your ambient light is set in hex with 0xrrggbb so if you want to cut everything in the color in half, you use 020202, but if you wanted more blue, you'd use 020204, for example, just remember it's ambient light you're working with and very easy to over-saturate light in the scene, so keep it low, i usually stick around .2 * my point or directional light source (e.g. sunlight, lamp, whatever)
let me know if this helps :)