summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl
diff options
context:
space:
mode:
authorluchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 22:54:47 +0000
committerluchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 22:54:47 +0000
commitc925b4bab4abc7f6b72f7408b7ec75bb49851033 (patch)
tree603cd72b673552fcb98c98accf6bc66a59b50e74 /o3d/samples/o3d-webgl
parent740f19ec5c056e340fae3343a7678448e897275f (diff)
downloadchromium_src-c925b4bab4abc7f6b72f7408b7ec75bb49851033.zip
chromium_src-c925b4bab4abc7f6b72f7408b7ec75bb49851033.tar.gz
chromium_src-c925b4bab4abc7f6b72f7408b7ec75bb49851033.tar.bz2
Adding instancing and render target demos.
Note: json scene for yard.o3dtgz; replaced this with teapot. (How much effort does it take to generate yard json scene?) Also, the instancing demos run sluggishly. (Limitation of JS?) Review URL: http://codereview.chromium.org/2714013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl')
-rw-r--r--o3d/samples/o3d-webgl/viewport.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/o3d/samples/o3d-webgl/viewport.js b/o3d/samples/o3d-webgl/viewport.js
index a9ffebc..36eea87 100644
--- a/o3d/samples/o3d-webgl/viewport.js
+++ b/o3d/samples/o3d-webgl/viewport.js
@@ -38,7 +38,7 @@
* area. The depth range is represented by an array in the format
* [min Z, max Z]. The depth range provides the mapping of the clip space
* coordinates into normalized z buffer coordinates.
- *
+ *
* @param {o3d.math.Float4} viewport The viewport setting.
* @param {o3d.math.Float2} depthRange ParamFloat2 The depth range setting.
* @constructor
@@ -80,7 +80,8 @@ o3d.ParamObject.setUpO3DParam_(o3d.Viewport, 'depthRange', 'ParamFloat2');
*/
o3d.Viewport.prototype.before = function() {
var x = this.viewport[0] * this.gl.displayInfo.width;
- var y = this.viewport[1] * this.gl.displayInfo.height;
+ var y = (1 - this.viewport[1] - this.viewport[3]) *
+ this.gl.displayInfo.height;
var width = this.viewport[2] * this.gl.displayInfo.width;
var height = this.viewport[3] * this.gl.displayInfo.height;