我正在使用紋理作爲Three.JS中的環境貼圖 - 並且我不確定鋤頭是否實現了此功能。以下是我的材料到目前爲止的代碼:將紋理用作環境貼圖
var shader : THREE.Shader = THREE.ShaderLib[ "normalmap" ];
var uniforms : THREE.Uniforms = THREE.UniformsUtils.clone(shader.uniforms);
uniforms[ "enableAO" ].value = false;
uniforms[ "enableDiffuse" ].value = true;
uniforms[ "enableSpecular" ].value = true;
uniforms[ "enableReflection" ].value = true;
uniforms[ "enableDisplacement" ].value = false;
uniforms[ "tNormal" ].value = THREE.ImageUtils.loadTexture(this.earthMaterials.earthNormal);
uniforms[ "tDiffuse" ].value = THREE.ImageUtils.loadTexture(this.earthMaterials.earthMap);
uniforms[ "tSpecular" ].value = THREE.ImageUtils.loadTexture(this.earthMaterials.earthMap);
uniforms[ "uNormalScale" ].value.set(this.earthMaterials.normalScale, this.earthMaterials.normalScale);
uniforms[ "uDiffuseColor" ].value.convertGammaToLinear();
uniforms[ "uSpecularColor" ].value.convertGammaToLinear();
uniforms[ "uAmbientColor" ].value.convertGammaToLinear();
var parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms, lights: true, fog: false };
this.earthNormal = new THREE.ShaderMaterial(parameters);
如何將紋理用作環境貼圖?
謝謝你的幫助!
這裏沒有問題。 – gaitat
啊 - 對不起(多麼尷尬)......編輯我的帖子......謝謝...... – user2386872
你的意思是環境遮擋貼圖嗎?展示你迄今爲止工作的一個實例,然後詢問關於它的具體問題。 – WestLangley