提交 2a8a4e39 编写于 作者: M Mr.doob

More tweaks to skin examples.

上级 f7854553
......@@ -106,10 +106,7 @@
// LIGHTS
directionalLight = new THREE.DirectionalLight( 0xffffff, 2.25 );
directionalLight.position.set( 1, -0.5, 1 );
scene.add( directionalLight );
directionalLight.position.multiplyScalar( 500 );
directionalLight.position.set( 500, - 250, 500 );
directionalLight.castShadow = true;
//directionalLight.shadowCameraVisible = true;
......@@ -128,10 +125,12 @@
directionalLight.shadowBias = -0.005;
directionalLight.shadowDarkness = 0.2;
scene.add( directionalLight );
//
directionalLight2 = new THREE.DirectionalLight( 0x8888ff, 0.5 );
directionalLight2.position.set( - 1, 0.5, -1 );
directionalLight2 = new THREE.DirectionalLight( 0x8888ff, 0.75 );
directionalLight2.position.set( - 500, 250, - 500 );
scene.add( directionalLight2 );
//
......
......@@ -104,12 +104,12 @@
// LIGHTS
directionalLight = new THREE.DirectionalLight( 0xffeedd, 2 );
directionalLight.position.set( 1, 0.5, 1 ).normalize();
directionalLight = new THREE.DirectionalLight( 0xffeedd, 1.5 );
directionalLight.position.set( 1, 0.5, 1 );
scene.add( directionalLight );
directionalLight = new THREE.DirectionalLight( 0xddddff, 0.5 );
directionalLight.position.set( -1, 0.5, -1 ).normalize();
directionalLight.position.set( -1, 0.5, -1 );
scene.add( directionalLight );
// MATERIALS
......@@ -179,13 +179,12 @@
// POSTPROCESSING
var renderModelUV = new THREE.RenderPass( scene, camera, materialUV, new THREE.Color( 0x575757 ) );
var renderModel = new THREE.RenderPass( scene, camera );
var effectCopy = new THREE.ShaderPass( THREE.CopyShader );
var effectBloom1 = new THREE.BloomPass( 1, 15, 2, 512 );
var effectBloom2 = new THREE.BloomPass( 1, 25, 4, 512 );
var effectBloom3 = new THREE.BloomPass( 1, 25, 8, 512 );
var effectBloom2 = new THREE.BloomPass( 1, 25, 3, 512 );
var effectBloom3 = new THREE.BloomPass( 1, 25, 4, 512 );
effectBloom1.clear = true;
effectBloom2.clear = true;
......@@ -195,7 +194,13 @@
//
var pars = { minFilter: THREE.LinearMipmapLinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
var pars = {
minFilter: THREE.LinearMipmapLinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
stencilBuffer: false
};
var rtwidth = 512;
var rtheight = 512;
......@@ -226,28 +231,11 @@
//
var effectBeckmann = new THREE.ShaderPass( THREE.ShaderSkin[ "beckmann" ] );
composerBeckmann = new THREE.EffectComposer( renderer, new THREE.WebGLRenderTarget( rtwidth, rtheight, pars ) );
composerBeckmann.addPass( effectBeckmann );
//
var effectBloom = new THREE.BloomPass( 0.25 );
var effectBleach = new THREE.ShaderPass( THREE.BleachBypassShader );
effectBleach.uniforms.opacity.value = 0.25;
effectBleach.renderToScreen = true;
composerFinal = new THREE.EffectComposer( renderer );
composerFinal.addPass( renderModel );
composerFinal.addPass( effectBloom );
composerFinal.addPass( effectBleach );
//
uniforms[ "tBlur1" ].value = composerScene.renderTarget2;
uniforms[ "tBlur2" ].value = composerUV1.renderTarget2;
uniforms[ "tBlur3" ].value = composerUV2.renderTarget2;
......@@ -315,7 +303,6 @@
renderer.clear();
if ( firstPass ) {
composerBeckmann.render();
......@@ -329,12 +316,10 @@
composerUV2.render();
composerUV3.render();
//composerFinal.render( 0.1 );
renderer.render( scene, camera );
}
</script>
</body>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册