Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Unified Diff: samples/o3d-webgl/param.js

Issue 1703014: Added culling sample. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/o3d-webgl/pack.js ('k') | samples/o3d-webgl/primitive.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/o3d-webgl/param.js
===================================================================
--- samples/o3d-webgl/param.js (revision 45983)
+++ samples/o3d-webgl/param.js (working copy)
@@ -589,7 +589,7 @@
*/
o3d.ViewProjectionParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view'];
+ this.matrix_names_ = ['viewProjection'];
};
o3d.inherit('ViewProjectionParamMatrix4', 'CompositionParamMatrix4');
@@ -599,7 +599,7 @@
*/
o3d.ViewProjectionInverseParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view'];
+ this.matrix_names_ = ['viewProjection'];
this.inverse_ = true;
};
o3d.inherit('ViewProjectionInverseParamMatrix4', 'CompositionParamMatrix4');
@@ -610,7 +610,7 @@
*/
o3d.ViewProjectionTransposeParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view'];
+ this.matrix_names_ = ['viewProjection'];
this.transpose_ = true;
};
o3d.inherit('ViewProjectionTransposeParamMatrix4', 'CompositionParamMatrix4');
@@ -621,7 +621,7 @@
*/
o3d.ViewProjectionInverseTransposeParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view'];
+ this.matrix_names_ = ['viewProjection'];
this.inverse_ = true;
this.transpose_ = true;
};
@@ -725,7 +725,7 @@
*/
o3d.WorldViewProjectionParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view', 'world'];
+ this.matrix_names_ = ['worldViewProjection'];
};
o3d.inherit('WorldViewProjectionParamMatrix4',
'CompositionParamMatrix4');
@@ -736,7 +736,7 @@
*/
o3d.WorldViewProjectionInverseParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view', 'world'];
+ this.matrix_names_ = ['worldViewProjection'];
this.inverse_ = true;
};
o3d.inherit('WorldViewProjectionInverseParamMatrix4',
@@ -748,7 +748,7 @@
*/
o3d.WorldViewProjectionTransposeParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view', 'world'];
+ this.matrix_names_ = ['worldViewProjection'];
this.transpose_ = true;
};
o3d.inherit('WorldViewProjectionTransposeParamMatrix4',
@@ -760,7 +760,7 @@
*/
o3d.WorldViewProjectionInverseTransposeParamMatrix4 = function() {
o3d.CompositionParamMatrix4.call(this);
- this.matrix_names_ = ['projection', 'view', 'world'];
+ this.matrix_names_ = ['worldViewProjection'];
this.inverse_ = true;
this.transpose_ = true;
};
@@ -822,11 +822,14 @@
var value = null;
var target = 0;
- if (this.value) {
- this.value.bindAndSetParameters_();
- gl.uniform1i(location, i);
- o3d.Param.texture_index_++;
+ if (this.value && this.value.texture && this.value.texture.texture_) {
+ value = this.value.texture.texture_;
+ target = this.value.texture.texture_target_;
}
+
+ gl.bindTexture(target, value);
+ gl.uniform1i(location, i);
+ o3d.Param.texture_index_++;
};
@@ -911,16 +914,19 @@
* SAS parameters.
*/
o3d.Param.SAS.setProjection = function(projection) {
- // TODO(petersont): this wasn't being used. Need to adjust all of
- // the handwritten GLSL shaders to incorporate the modification of
- // gl_Position based on dx_clipping.
- /*
- var adjustedProjection =
- [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 2, 0], [0, 0, -1, 1]];
- o3d.Transform.compose(
- adjustedProjection, projection, adjustedProjection);
- */
this['projection'] = projection;
};
+/**
+ * Sets the viewProjection matrix.
+ */
+o3d.Param.SAS.setViewProjection = function(viewProjection) {
+ this['viewProjection'] = viewProjection;
+};
+/**
+ * Sets the worldViewProjection matrix.
+ */
+o3d.Param.SAS.setWorldViewProjection = function(worldViewProjection) {
+ this['worldViewProjection'] = worldViewProjection;
+};
« no previous file with comments | « samples/o3d-webgl/pack.js ('k') | samples/o3d-webgl/primitive.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698