Using javascript to detect device CPU/GPU performance?

人走茶凉 提交于 2019-12-03 05:58:08

I've ended up using a performance measurement approach on a project where we wanted to utilise canvas features that are available on high spec CPU/GPU desktops, as well as lower speed devices such as tables and phones.

Basically we start at a minimum scene complexity, and if the renderloop takes less than 33ms we add complexity (we also reduce complexity if the renderloop starts taking too long at a later time).

I suppose in your case you might have to run a quick canvas and webgl performance test and then choose one. Having spent some time researching this I've not come across some tricky non-obvious technique that solves this better.

You can use http://webglstats.com/ for WebGL hardware support and feature detection.

If your using three.js you can just use the detector.js to find out if webgl is enabled. also staying away from the canvasrenderer will help. use the webglrenderer or the softwarerender. as they allow for more vertices. the softwarerender is fairly new and needs some work but can be used.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!