repo: janusweb action: commit revision: path_from: revision_from: 9ed3130aca6890f4b63128afd50229d46f5c5007: path_to: revision_to:
commit 9ed3130aca6890f4b63128afd50229d46f5c5007 Author: James BaicoianuDate: Fri Nov 5 16:34:41 2021 -0700 Fix transparency diff --git a/scripts/image.js b/scripts/image.js
--- a/scripts/image.js
+++ b/scripts/image.js
@@ -55,7 +55,7 @@ elation.require(['janusweb.janusbase'], function() {
color: this.properties.color,
transparent: (this.opacity < 1),
opacity: this.opacity,
- alphaTest: 0.2
+ alphaTest: this.alphatest
};
this.asset = this.getAsset('image', this.image_id);
@@ -68,6 +68,9 @@ elation.require(['janusweb.janusbase'], function() {
elation.events.add(this.texture, 'update', elation.bind(this, this.refresh));
matargs.transparent = this.asset.hasalpha;
+ elation.events.add(this.asset, 'asset_load', ev => {
+ matargs.transparent = this.asset.hasalpha;
+ });
}
}
if (this.texture) {
@@ -156,6 +159,9 @@ elation.require(['janusweb.janusbase'], function() {
this.sidetex.image = this.texture.image;
this.sidetex.needsUpdate = true;
+ this.frontmaterial.transparent = this.asset.hasalpha;
+ this.sidematerial.transparent = this.asset.hasalpha;
+
if (this.properties.sbs3d || this.asset.sbs3d) {
// TODO - to really support 3d video, we need to set offset based on which eye is being rendered
var texture = new THREE.SBSTexture(this.texture.image);
-----END OF PAGE-----