<commit_before><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - effects - cardboard</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				margin: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>

		<script src="../build/three.js"></script>

		<script src="js/controls/VRControls.js"></script>
		<script src="js/effects/VREffect.js"></script>
		<script src="js/vr/WebVR.js"></script>

		<script>

			if ( WEBVR.isAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var camera, scene, renderer;
			var effect, controls;

			init();
			animate();

			function init() {

				scene = new THREE.Scene();

				var dummy = new THREE.Camera();
				dummy.position.set( 2, 1, 2 );
				dummy.lookAt( scene.position );
				scene.add( dummy );

				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
				dummy.add( camera );

				var geometry = new THREE.TorusKnotGeometry( 0.4, 0.15, 150, 20 );
				var material = new THREE.MeshStandardMaterial( { roughness: 0.01, metalness: 0.2 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = 0.75;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var geometry = new THREE.BoxGeometry( 3, 0.1, 3 );
				var material = new THREE.MeshStandardMaterial( { roughness: 1.0, metalness: 0.0 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = - 0.1;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var light = new THREE.DirectionalLight( 0x8800ff );
				light.position.set( - 1, 1.5, 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				var light = new THREE.DirectionalLight( 0xff0000 );
				light.position.set( 1, 1.5, - 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				//

				renderer = new THREE.WebGLRenderer( { antialias: true } );
				renderer.setClearColor( 0x101010 );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				renderer.shadowMap.enabled = true;
				document.body.appendChild( renderer.domElement );<commit_msg>Added mirror to webvr_shadow example.<commit_after><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - effects - cardboard</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				margin: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>

		<script src="../build/three.js"></script>

		<script src="js/controls/VRControls.js"></script>
		<script src="js/effects/VREffect.js"></script>
		<script src="js/vr/WebVR.js"></script>

		<script src="js/Mirror.js"></script>

		<script>

			if ( WEBVR.isAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var camera, scene, renderer;
			var effect, controls;

			var mirror;

			init();
			animate();

			function init() {

				scene = new THREE.Scene();

				var dummy = new THREE.Camera();
				dummy.position.set( 0, 0.5, 3 );
				dummy.lookAt( new THREE.Vector3( 0, 0.5, 0 ) );
				scene.add( dummy );

				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
				dummy.add( camera );

				var geometry = new THREE.TorusKnotGeometry( 0.4, 0.15, 150, 20 );
				var material = new THREE.MeshStandardMaterial( { roughness: 0.01, metalness: 0.2 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = 0.75;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var geometry = new THREE.BoxGeometry( 1.5, 0.1, 1.5 );
				var material = new THREE.MeshStandardMaterial( { roughness: 1.0, metalness: 0.0 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = - 0.2;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var light = new THREE.DirectionalLight( 0x8800ff );
				light.position.set( - 1, 1.5, 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				var light = new THREE.DirectionalLight( 0xff0000 );
				light.position.set( 1, 1.5, - 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				//

				mirror = new THREE.Mirror( 1.4, 1.4, { textureWidth: window.innerWidth, textureHeight: window.innerHeight } );
				mirror.position.x = 1;
				mirror.position.y = 0.5;
				mirror.position.z = -1;
				mirror.rotation.y = - Math.PI / 4;
				scene.add( mirror );

				var geometry = new THREE.BoxGeometry( 1.5, 1.5, 0.1 );
				var material = new THREE.MeshStandardMaterial( { roughness: 1.0, metalness: 0.0 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.z = - 0.07;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				mirror.add( mesh );

				//

				renderer = new THREE.WebGLRenderer( { antialias: true } );
				renderer.setClearColor( 0x101010 );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				renderer.shadowMap.enabled = true;
				document.body.appendChild( renderer.domElement );
{'fraction_non_alphanumeric': 0.15263644773358, 'fraction_numerical': 0.03145235892691952, 'mean_word_length': 2.894812680115274, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3277598', 'n_tokens_mistral': 2355, 'n_tokens_neox': 1808, 'n_words': 421}