repo: janusweb action: commit revision: path_from: revision_from: 5fbf7d7a4aa53166653e577f4573a82033039aa5: path_to: revision_to:
commit 5fbf7d7a4aa53166653e577f4573a82033039aa5 Author: James BaicoianuDate: Sun May 13 22:27:11 2018 -0700 sbs3d fix diff --git a/scripts/object.js b/scripts/object.js
--- 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-----