我希望在 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 );
如何使用纹理作为环境贴图?
感谢您的帮助 !