@xailabs/three-renderer-stats

Fork of https://github.com/jeromeetienne/threex.rendererstats

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@xailabs/three-renderer-stats
101.0.45 years ago5 years agoMinified + gzip package size for @xailabs/three-renderer-stats in KB

Readme

@xailabs/three-renderer-stats ======================================== FORKED FROM https://github.com/jeromeetienne/threex.rendererstats
  • Allow reset by calling update() without passing renderer
  • Published on npm
======================================== 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: ```javascript yarn add @xailabs/three-renderer-stats ``` Via npm: ```javascript npm install @xailabs/three-renderer-stats --save ```

How To Use It

```javascript import RendererStats from '@xailabs/three-renderer-stats'; const rendererStats = new RendererStats(); ``` position it on the page with css with something along this line: ```javascript 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: ```javascript rendererStats.update(renderer); ``` update it without passing anything (or passing something falsy) to reset the displayed output: ```javascript rendererStats.update(null); ```