我有一个场景,其中有一盏灯和钻石。 灯具性能: 点光源,位置:0 0 30,强度:1,距离60,颜色:白色。 钻石材料是Phong,颜色:红色,没有发光,镜面:白色,闪亮10.Firefox上的WebGL渲染 - 灯光效果显示比Chrome更暗
在Chrome浏览器上,diamons闪耀为假设,但在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的本质?我可以采取什么最好的措施来解决这个问题?
非常感谢
我已经使用另一台机器检查了网站,虽然纹理是RGBA 8位(更正),但该网站在LAMBERT/PHONG材料上显示完全黑暗,并在BASIC上显示正确的映射。我担心的是,照明是一个问题....但为什么然后它在除了我测试的其他浏览器上工作? (三星Galaxy 2上的火狐) - 如此有线,,,, – Xerix