@xailabs/three-renderer-stats
v1.0.4
Published
Fork of https://github.com/jeromeetienne/threex.rendererstats
Downloads
165
Keywords
Readme
@xailabs/three-renderer-stats
FORKED FROM https://github.com/jeromeetienne/threex.rendererstats
- Allow reset by calling
update()
without passing renderer - Published on npm
- Fix programs count (~ PR4)
========================================
It is a three.js extension to display realtime informations about THREE.WebGLRenderer
.
Here is a basic example. It is widely inpired from @mrdoob stats.js.
It is released under MIT license.
How To install it
Via yarn:
yarn add @xailabs/three-renderer-stats
Via npm:
npm install @xailabs/three-renderer-stats --save
How To Use It
import RendererStats from '@xailabs/three-renderer-stats';
const rendererStats = new RendererStats();
position it on the page with css with something along this line:
rendererStats.domElement.style.position = 'absolute'
rendererStats.domElement.style.left = '0px'
rendererStats.domElement.style.bottom = '0px'
document.body.appendChild( rendererStats.domElement )
finally update it at every frame, passing the webGLRenderer reference:
rendererStats.update(renderer);
update it without passing anything (or passing something falsy) to reset the displayed output:
rendererStats.update(null);