forked from chenzlabs/stats-in-vr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4633fe
commit e0cf01e
Showing
1 changed file
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
I've wanted this for a while, but I googled, found this, and then found a library that used to do what I wanted 5 years ago (and hadn't been touched since) in an older version of A-Frame. I've spent some time--arguably too much time--almost completely rewriting it, improving it, making it faster, lighter, and adding features. | ||
|
||
You can access it through jsdelivr's cdn here: https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].0/vr-super-stats.js | ||
You can access it through jsdelivr's cdn here: https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].1/vr-super-stats.js | ||
|
||
![vr-super-stats](https://user-images.githubusercontent.com/6391152/130007970-a512c190-0a4e-4f0d-8c40-0d8e1e9e58e8.png) | ||
![orange](https://user-images.githubusercontent.com/6391152/130179324-d68f276d-1ccf-4f7c-90fc-1a872bb4fe61.png) | ||
|
@@ -33,13 +33,13 @@ You can access it through jsdelivr's cdn here: https://cdn.jsdelivr.net/gh/kyleb | |
|
||
#### Browser | ||
|
||
Install and use by directly including the [browser file](https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].0/vr-super-stats.js): | ||
Install and use by directly including the [browser file](https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].1/vr-super-stats.js): | ||
|
||
```html | ||
<head> | ||
<title>My A-Frame Scene</title> | ||
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].0/vr-super-stats.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/kylebakerio/[email protected].1/vr-super-stats.js"></script> | ||
</head> | ||
|
||
<body> | ||
|
@@ -158,9 +158,9 @@ Or, see the examples in this repo. | |
scale: { type: "string", default: "1 .8 1" }, | ||
|
||
performancemode: { type: "boolean", default: false }, // set of defaults to focus on making it as light of impact as possible | ||
throttle: { type: "number", default: 15 }, // how many ms between recalc, has biggest effect on performance (try it out for yourself! hah) | ||
throttle: { type: "number", default: 50 }, // how many ms between recalc, has biggest effect on performance (which, here, you can easily see for yourself! hah.) | ||
|
||
backgroundcolor: { type:"color", default: "orange"}, // you can specify rgba colors as well. | ||
backgroundcolor: { type:"color", default: "orange"}, // you can specify semi-transparent colors using css style rgba(r,g,b,a) color declarations as well. | ||
|
||
show2dstats: { type: "boolean", default: true }, // show the built-in 'stats' component when not in VR | ||
alwaysshow3dstats: { type: "boolean", default: false }, // show this component even when not in VR | ||
|
@@ -169,13 +169,14 @@ Or, see the examples in this repo. | |
showlabels: {type: 'array', default:['raf','fps','geometries','programs','textures','calls','triangles','points','entities','load time']}, // please give all inputs in lowercase | ||
showgraphs: {type: 'array', default:['raf','fps','geometries','programs','textures','calls','triangles','points','entities','load time']}, // this will be auto-filtered down to match above, but you can filter down further if you want, say, 4 values in text, but only 1 in graph form. you can also select `null` or `false` or `[]` to turn off all graphs. | ||
|
||
// ADVANCED: | ||
|
||
// | ||
// advanced options: | ||
// | ||
|
||
// targetmax | ||
// targetmin | ||
// samplereport | ||
// ^ these three are defined below as custom schema options--basically, they take in JSON (if serializing or if defining in HTML, see examples) or straight up JS objects (if adding to scene programatically) | ||
// see examples for HTML usage guidance, syntax is very delicate for this | ||
// ^ these three are defined below as custom schema options--basically, they take in JSON (if serializing or if defining in HTML, see examples) or straight up JS objects (if adding to scene programatically) | ||
|
||
samplereport: { | ||
// all numbers in ms | ||
|
@@ -190,7 +191,7 @@ Or, see the examples in this repo. | |
}) | ||
*/ | ||
delay: 0, // if autostart true, how long after app launch to auto-start sampling | ||
samples: 60, // if autostart true, how many samples to take | ||
samples: 200, // if autostart true, how many samples to take | ||
displayDuration: 30000, // how long to leave report up in VR before auto-closing | ||
}), | ||
parse: json => { | ||
|
@@ -203,10 +204,12 @@ Or, see the examples in this repo. | |
// note that you can only have one or the other defined for a given property; for performance, only one will be checked per property. to maximize performance, set no targets. | ||
targetmax: { | ||
default: JSON.stringify({ | ||
calls: 200, // | ||
calls: 200, // too many draw calls kills responsiveness | ||
raf: 15, // needed to keep responsiveness around 60fps | ||
triangles: 100000, | ||
"load time": 3000, | ||
triangles: 100000, // rough limit for mobile experiences to be smooth | ||
"load time": 3000, // subjective | ||
points: 15000, // unsure, I've heard 20000 is a drag, but likely lower than that | ||
entities: 200, // unsure, I'm more familiar with draw calls, suggested improved number here welcome | ||
// you can specify your own targets for any stats props, and they'll turn red when they rise above target | ||
// this does come with a small performance penalty | ||
}), | ||
|
@@ -227,7 +230,7 @@ Or, see the examples in this repo. | |
}, | ||
targetmin: {// inverse of targetmax, for values where lower is better | ||
default: JSON.stringify({ | ||
fps: 75, | ||
fps: 75, // phones cap at 60, quest 1 aimed for 75. | ||
// you can specify targets for any stats props, and they'll turn red when they fall below target | ||
// this does come with a small performance penalty | ||
}), | ||
|