Skip to content

Commit

Permalink
Merge pull request #22 from AdaRoseCannon/compat-aframe-150
Browse files Browse the repository at this point in the history
Compatibility with aframe 1.5.0
  • Loading branch information
vincentfretin authored Jan 13, 2024
2 parents 4ef368a + 125a478 commit 319a9c2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
11 changes: 10 additions & 1 deletion build/aframe-html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/aframe-html.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/aframe-html.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/aframe-html.min.js.map

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions src/HTMLMesh.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a copy of https://github.com/mrdoob/three.js/blob/0403020848c26a9605eb91c99a949111ad4a532e/examples/jsm/interactive/HTMLMesh.js
// with the following changes:
// - Revert back to using "this.encoding = sRGBEncoding" instead of "this.colorSpace = SRGBColorSpace;" for compatibility with three r147 aframe 1.4.2
// - Keep compatibility with three r147 aframe 1.4.2, still using "this.encoding = sRGBEncoding", otherwise using "this.colorSpace = SRGBColorSpace;"
// - window.dispatchEvent line commented, see the TODO below.
// Look at https://github.com/mrdoob/three.js/commits/dev/examples/jsm/interactive/HTMLMesh.js
// to see if there are other changes that can be retrieved here.
Expand All @@ -10,6 +10,7 @@ import {
Mesh,
MeshBasicMaterial,
PlaneGeometry,
SRGBColorSpace,
sRGBEncoding,
Color
} from 'three';
Expand Down Expand Up @@ -65,7 +66,16 @@ class HTMLTexture extends CanvasTexture {
this.dom = dom;

this.anisotropy = 16;
this.encoding = sRGBEncoding;
if ( THREE.REVISION === '147' ) { // Keep compatibility with aframe 1.4.2

this.encoding = sRGBEncoding;

} else {

this.colorSpace = SRGBColorSpace;

}

this.minFilter = LinearFilter;
this.magFilter = LinearFilter;

Expand Down

0 comments on commit 319a9c2

Please sign in to comment.