【发布时间】:2016-04-15 17:38:53
【问题描述】:
我有一个场景,其中存在一盏灯和钻石。 光属性: 点光源,位置:0 0 30,强度:1,距离60,颜色:白色。 钻石材质为Phong,颜色:红色,不发光,镜面:白色,光泽度10。
在 Chrome 上,钻石会发光,但在 Firefox 上,钻石根本不发光,而且看起来很暗(就像上面有黑色的东西一样)。
我曾尝试在桌面 Windows 和 Android 手机上同时使用 Firefox。
我想问我错过了什么?
以下是我的代码中的设置:
// Renderer:
ren=new THREE.WebGLRenderer({ antialias:true,alpha:true });
ren.shadowMap.enabled=true;
elm.appendChild(ren.domElement); // the renderer is added to a DOM element "elm"
// Light
var o=new THREE.PointLight(0xffffff,1,60);
o.position.set(0,0,30);
o.name="sun"; // light will be later added to the scene, and use "update materials" flag to update the materials of the entire scene.
// The diamond's material: (I gave a new parameter "name", for later use. I guess it should not makes trouble to the engine....)
var mt=new THREE.MeshPhongMaterial({ name:"RedDiamond", transparent:true, opacity:0.85, fog:false, color:0xff0020, specular:0xffffff, shininess:10 });
现场示例可以看这里:https://www.crazygao.com/VideoGames/Lamps,从第一关开始(加载可能只是第一次需要一些时间,但开场场景尚未完成)。即使在进度场景中也可以看到照明差异问题(使用闪光灯)
我的问题:我应该怎么做才能让钻石在 Firefox 中闪耀,但又不会让整个场景在 Chrome 中太亮? (我尝试在场景中添加环境光,然后在 Chrome 中它变得太亮了......)
问题是出自我的设置,还是 Firefox 的本质问题?我可以采取哪些最佳步骤来解决此问题?
非常感谢
【问题讨论】: