Bläddra i källkod

finer grain timing.

Ben Houston 9 år sedan
förälder
incheckning
dfd876dff2

+ 2 - 1
examples/canvas_ascii_effect.html

@@ -116,8 +116,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/canvas_camera_orthographic.html

@@ -145,8 +145,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/canvas_camera_orthographic2.html

@@ -208,8 +208,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/canvas_geometry_birds.html

@@ -420,8 +420,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/canvas_geometry_cube.html

@@ -193,8 +193,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 3 - 1
examples/webgl_animation_skinning_blending.html

@@ -235,6 +235,8 @@
 
 
 				requestAnimationFrame( animate, renderer.domElement );
 				requestAnimationFrame( animate, renderer.domElement );
 
 
+				stats.begin();
+
 				// step forward in time based on whether we're stepping and scale
 				// step forward in time based on whether we're stepping and scale
 
 
 				var scale = gui.getTimeScale();
 				var scale = gui.getTimeScale();
@@ -248,7 +250,7 @@
 				gui.update( blendMesh.mixer.time );
 				gui.update( blendMesh.mixer.time );
 
 
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );
-				stats.update();
+				stats.end();
 
 
 				// if we are stepping, consume time
 				// if we are stepping, consume time
 				// ( will equal step size next time a single step is desired )
 				// ( will equal step size next time a single step is desired )

+ 2 - 1
examples/webgl_animation_skinning_morph.html

@@ -635,8 +635,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 				if ( showMemInfo ) {
 				if ( showMemInfo ) {
 
 

+ 2 - 2
examples/webgl_materials_displacementmap.html

@@ -284,9 +284,9 @@
 
 
 				controls.update();
 				controls.update();
 
 
+				stats.begin();
 				render();
 				render();
-
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_materials_envmaps_hdr.html

@@ -257,8 +257,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_materials_texture_manualmipmap.html

@@ -240,8 +240,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_materials_transparency.html

@@ -214,8 +214,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_materials_variations_phong.html

@@ -215,8 +215,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_postprocessing_advanced.html

@@ -359,8 +359,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_postprocessing_dof.html

@@ -278,8 +278,9 @@
 
 
 				requestAnimationFrame( animate, renderer.domElement );
 				requestAnimationFrame( animate, renderer.domElement );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_postprocessing_godrays.html

@@ -255,8 +255,9 @@
 
 
 				requestAnimationFrame( animate, renderer.domElement );
 				requestAnimationFrame( animate, renderer.domElement );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 3 - 2
examples/webgl_postprocessing_msaa.html

@@ -164,6 +164,8 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
+
 				for ( var i = 0; i < scene.children.length; i ++ ) {
 				for ( var i = 0; i < scene.children.length; i ++ ) {
 
 
 					var child = scene.children[ i ];
 					var child = scene.children[ i ];
@@ -174,8 +176,7 @@
 				}
 				}
 
 
 				composer.render();
 				composer.render();
-
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 3 - 1
examples/webgl_postprocessing_smaa.html

@@ -108,6 +108,8 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
+
 				for ( var i = 0; i < scene.children.length; i ++ ) {
 				for ( var i = 0; i < scene.children.length; i ++ ) {
 
 
 					var child = scene.children[ i ];
 					var child = scene.children[ i ];
@@ -119,7 +121,7 @@
 
 
 				composer.render();
 				composer.render();
 
 
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_postprocessing_ssao.html

@@ -191,8 +191,9 @@ Spiral sampling http://web.archive.org/web/20120421191837/http://www.cgafaq.info
 			function animate() {
 			function animate() {
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 			}
 			}
 
 
 			function render() {
 			function render() {

+ 2 - 1
examples/webgl_shading_physical.html

@@ -429,8 +429,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_shadowmap_performance.html

@@ -369,8 +369,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}
 
 

+ 2 - 1
examples/webgl_tonemapping.html

@@ -252,8 +252,9 @@
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
 
 
+				stats.begin();
 				render();
 				render();
-				stats.update();
+				stats.end();
 
 
 			}
 			}