Browse Source

More tweaks to skin examples.

Mr.doob 10 years ago
parent
commit
2a8a4e39fa
2 changed files with 17 additions and 33 deletions
  1. 5 6
      examples/webgl_materials_bumpmap_skin.html
  2. 12 27
      examples/webgl_materials_skin.html

+ 5 - 6
examples/webgl_materials_bumpmap_skin.html

@@ -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 );
 
 				//

+ 12 - 27
examples/webgl_materials_skin.html

@@ -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>