提交 5e00de2c 编写于 作者: M Mr.doob

Examples: Improved webgl_shaders_ocean.

上级 9e81dfcc
......@@ -110,8 +110,6 @@
// Skybox
var sky = new THREE.Sky();
sky.scale.setScalar( 10000 );
scene.add( sky );
var uniforms = sky.material.uniforms;
......@@ -127,10 +125,12 @@
azimuth: 0.205
};
var cubeCamera = new THREE.CubeCamera( 1, 20000, 256 );
var cubeCamera = new THREE.CubeCamera( 0.1, 1, 512 );
cubeCamera.renderTarget.texture.generateMipmaps = true;
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;
scene.background = cubeCamera.renderTarget;
function updateSun() {
var theta = Math.PI * ( parameters.inclination - 0.5 );
......@@ -143,7 +143,7 @@
sky.material.uniforms[ 'sunPosition' ].value = light.position.copy( light.position );
water.material.uniforms[ 'sunDirection' ].value.copy( light.position ).normalize();
cubeCamera.update( renderer, scene );
cubeCamera.update( renderer, sky );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册