-
Notifications
You must be signed in to change notification settings - Fork 31
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
Showing
18 changed files
with
1,231 additions
and
788 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
minify/ | ||
minify/ | ||
demo_planet.html | ||
demo_edsm.html | ||
js/ed3dplanet.js | ||
json_samples/eddb.json | ||
json_samples/edsm.json |
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
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
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
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
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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
threex.rendererstats | ||
==================== | ||
|
||
It is a three.js extension to display realtime informations about ```THREE.WebGLRenderer```. | ||
Here is a [basic example](http://jeromeetienne.github.io/threex.rendererstats/examples/basic.html). It is widely inpired from @mrdoob [stats.js](https://github.com/mrdoob/stats.js/). | ||
It is released under MIT license. | ||
|
||
## How To install it | ||
|
||
You can install it manually or with | ||
[bower](http://bower.io/). | ||
for the manual version, first include ```threex.rendererstats.js``` with the usual | ||
|
||
```html | ||
<script src='threex.rendererstats.js'></script> | ||
``` | ||
|
||
or with | ||
[bower](http://bower.io/) | ||
you type the following to install the package. | ||
|
||
```bash | ||
bower install -s threex.rendererstats=https://github.com/jeromeetienne/threex.rendererstats/archive/master.zip | ||
``` | ||
|
||
then you add that in your html | ||
|
||
```html | ||
<script src="bower_components/threex.rendererstats/threex.rendererstats.js"></script> | ||
``` | ||
|
||
## How To Use It | ||
|
||
``` | ||
var rendererStats = new THREEx.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 | ||
|
||
``` | ||
rendererStats.update(renderer); | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* @author mrdoob / http://mrdoob.com/ | ||
* @author jetienne / http://jetienne.com/ | ||
*/ | ||
/** @namespace */ | ||
var THREEx = THREEx || {} | ||
|
||
/** | ||
* provide info on THREE.WebGLRenderer | ||
* | ||
* @param {Object} renderer the renderer to update | ||
* @param {Object} Camera the camera to update | ||
*/ | ||
THREEx.RendererStats = function (){ | ||
|
||
var msMin = 100; | ||
var msMax = 0; | ||
|
||
var container = document.createElement( 'div' ); | ||
container.style.cssText = 'width:80px;opacity:0.9;cursor:pointer'; | ||
|
||
var msDiv = document.createElement( 'div' ); | ||
msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#200;'; | ||
container.appendChild( msDiv ); | ||
|
||
var msText = document.createElement( 'div' ); | ||
msText.style.cssText = 'color:#f00;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px'; | ||
msText.innerHTML= 'WebGLRenderer'; | ||
msDiv.appendChild( msText ); | ||
|
||
var msTexts = []; | ||
var nLines = 9; | ||
for(var i = 0; i < nLines; i++){ | ||
msTexts[i] = document.createElement( 'div' ); | ||
msTexts[i].style.cssText = 'color:#f00;background-color:#311;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px'; | ||
msDiv.appendChild( msTexts[i] ); | ||
msTexts[i].innerHTML= '-'; | ||
} | ||
|
||
|
||
var lastTime = Date.now(); | ||
return { | ||
domElement: container, | ||
|
||
update: function(webGLRenderer){ | ||
// sanity check | ||
console.assert(webGLRenderer instanceof THREE.WebGLRenderer) | ||
|
||
// refresh only 30time per second | ||
if( Date.now() - lastTime < 1000/30 ) return; | ||
lastTime = Date.now() | ||
|
||
var i = 0; | ||
msTexts[i++].textContent = "== Memory ====="; | ||
msTexts[i++].textContent = "Programs: " + webGLRenderer.info.memory.programs; | ||
msTexts[i++].textContent = "Geometries: "+webGLRenderer.info.memory.geometries; | ||
msTexts[i++].textContent = "Textures: " + webGLRenderer.info.memory.textures; | ||
|
||
msTexts[i++].textContent = "== Render ====="; | ||
msTexts[i++].textContent = "Calls: " + webGLRenderer.info.render.calls; | ||
msTexts[i++].textContent = "Vertices: " + webGLRenderer.info.render.vertices; | ||
msTexts[i++].textContent = "Faces: " + webGLRenderer.info.render.faces; | ||
msTexts[i++].textContent = "Points: " + webGLRenderer.info.render.points; | ||
} | ||
} | ||
}; |
Oops, something went wrong.