summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/sampler.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3d-webgl/sampler.js')
-rw-r--r--o3d/samples/o3d-webgl/sampler.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/o3d/samples/o3d-webgl/sampler.js b/o3d/samples/o3d-webgl/sampler.js
index e4d6513..60f94c0 100644
--- a/o3d/samples/o3d-webgl/sampler.js
+++ b/o3d/samples/o3d-webgl/sampler.js
@@ -260,13 +260,19 @@ o3d.Sampler.defaultSampler_.magFilter = o3d.Sampler.POINT;
/**
* Binds the texture for this sampler and sets texParameters according to the
* states of the sampler.
+ * @param {boolean} opt_isCube Optional boolean indicating if this is a cube
+ * map, so we can use the right error texture.
*/
-o3d.Sampler.prototype.bindAndSetParameters_ = function() {
+o3d.Sampler.prototype.bindAndSetParameters_ = function(opt_isCube) {
var currentTexture = null;
if (this.texture) {
currentTexture = this.texture;
} else if (!this.gl.client.reportErrors_()) {
- currentTexture = this.gl.client.error_texture_;
+ if (opt_isCube) {
+ currentTexture = this.gl.client.error_texture_cube_;
+ } else {
+ currentTexture = this.gl.client.error_texture_;
+ }
} else {
currentTexture = this.gl.client.fallback_error_texture_;
this.gl.client.error_callback("Missing texture for sampler " + this.name);