1
您好我想與三個地圖(瀰漫正常和鏡面)網格和由於某種原因,網格將不會渲染 這裏是我創建網格的代碼。三JS着色器庫 - 多紋理
function initGlobe()
{
var surfaceMap = {map:THREE.ImageUtils.loadTexture("images/earth_surface_2048.jpg")};
var normalMap = {map:THREE.ImageUtils.loadTexture("images/earth_normal_2048.jpg")};
var specularMap = {map:THREE.ImageUtils.loadTexture("images/earth_specular_2048.jpg")};
var shader = THREE.ShaderLib[ "normalmap" ];
var uniforms = shader.uniforms;
uniforms["tDiffuse"].value = surfaceMap;
uniforms["tNormal"].value = normalMap;
uniforms["tSpecular"].value = specularMap;
uniforms["enableDiffuse"].value = true;
uniforms["enableSpecular"].value = true;
var shaderMaterial = new THREE.ShaderMaterial(
{fragmentShader:shader.fragmentShader,vertexShader:shader.vertexShader,
uniforms:uniforms, lights:true}
);
// old ver - delete later var material = new THREE.MeshPhongMaterial(surfaceMap);
var geometry = new THREE.SphereGeometry(1,32,32);
geometry.computeTangents();
return new THREE.Mesh(geometry, shaderMaterial);
}
thx il下載r56遲了,但現在我正在與55,你可以sop任何outher的原因,這不會工作嗎? – 2013-02-21 04:39:25
說它不會工作是不是很豐富。 – WestLangley 2013-02-21 05:13:02
那麼我得到沒有錯誤的網格只是不會渲染,如果我使用舊的表面網格之前它使用,所以問題必須在我提交的代碼。 – 2013-02-21 06:56:27