Skip to content

Commit

Permalink
Check in raytracing_sandbox_workers.html this time
Browse files Browse the repository at this point in the history
  • Loading branch information
zz85 committed Nov 24, 2015
1 parent 2fdfc3d commit 0895798
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions examples/raytracing_sandbox_workers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js - raytracing renderer with web workers</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Monospace;
color: #ffffff;
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<script src="../build/three.min.js"></script>
<script src="js/renderers/RaytracingWorkerRenderer.js"></script>

<script>

var hash = location.hash ? location.hash.substring(1) : '4';

var WORKERS = +hash || navigator.hardwareConcurrency || 4;

var container;

var camera, controls, scene, renderer;

var torus, cube;

init();
render();

function init() {

container = document.createElement( 'div' );
document.body.appendChild( container );

var info = document.createElement( 'div' );
info.style.position = 'absolute';
info.style.top = '10px';
info.style.width = '100%';
info.style.zIndex = '100';
info.style.textAlign = 'center';
info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js<a/> - raytracing renderer (using ' + WORKERS + ' web workers)';
container.appendChild( info );

//

renderer = new THREE.RaytracingWorkerRenderer({
workers: WORKERS
});
renderer.setClearColor( 0xf0f0f0 );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.domElement.style.position = "absolute";
renderer.domElement.style.top = "0px";
renderer.domElement.style.left = "0px";

container.appendChild( renderer.domElement );

}

function render() {

renderer.render( scene, camera );

}

</script>

</body>
</html>

0 comments on commit 0895798

Please sign in to comment.