repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 5fbf7d7a4aa53166653e577f4573a82033039aa5:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 5fbf7d7a4aa53166653e577f4573a82033039aa5
Author: James Baicoianu 
Date:   Sun May 13 22:27:11 2018 -0700

    sbs3d fix

diff --git a/scripts/object.js b/scripts/object.js
index ffe5331bc2d59cc15fa9a5e06de49c9a386b2bdd..
index ..092b321d074689e122ad42f2a5a94b7798d156cb 100644
--- a/scripts/object.js
+++ b/scripts/object.js
@@ -344,6 +344,15 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
               if (!color) m.color.setHex(0xffffff);
               m.map = texture; 
               elation.events.add(texture, 'asset_update', (ev) => { m.map = ev.data; this.refresh(); });
+
+              // Set up per-eye render hooks if we're using a 3D texture
+              if (texture instanceof THREE.SBSTexture) {
+                n.onBeforeRender = (renderer, scene, camera) => {
+                  if (camera.name) {
+                    texture.setEye(camera.name);
+                  }
+                }
+              }
               m.transparent = (textureasset && textureasset.hasalpha) || m.opacity < 1;
             } else if (m.map && m.map.sourceFile) {
               var imagesrc = m.map.sourceFile;

-----END OF PAGE-----