Skip to content

Commit a3304f8

Browse files
author
lynndang
committed
[1.5.0] Updated changes to the new 1.5.0 including only supporting webgl2
1 parent 0ed964c commit a3304f8

12 files changed

+34
-80
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 8Frame
2+
3+
8Frame is 8th Wall's modified version of AFrame. It has the following changes
4+
- 8Frame exposes properties in THREE.js's `WebGLRenderer` so that it's compatible with MRCS HoloVideoObject.
5+
- 8Frame improves AFrame's compatibility with XR8.
6+
17
<h1 align="center">A-Frame</h1>
28

39
<p align="center"><a href="https://aframe.io" target="_blank"><img width="480" alt="A-Frame" src="https://user-images.githubusercontent.com/674727/32120889-230ef110-bb0f-11e7-908c-76e39aa43149.jpg"></a></p>

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"ghpages": "ghpages -p gh-pages/",
1515
"lint": "standardx -v | snazzy",
1616
"lint:fix": "standardx --fix",
17-
"postinstall": "patch-package",
1817
"precommit": "npm run lint",
1918
"prepush": "node scripts/testOnlyCheck.js",
2019
"prerelease": "node scripts/release.js 1.4.0 1.5.0",
@@ -79,7 +78,6 @@
7978
"karma-webpack": "^5.0.0",
8079
"markserv": "github:sukima/markserv#feature/fix-broken-websoketio-link",
8180
"mocha": "^10.0.0",
82-
"patch-package": "^6.2.0",
8381
"replace-in-file": "^2.5.3",
8482
"shelljs": "^0.7.7",
8583
"shx": "^0.2.2",
@@ -125,4 +123,4 @@
125123
"node": ">= 4.6.0",
126124
"npm": ">= 2.15.9"
127125
}
128-
}
126+
}

patches/super-three+0.147.1.patch

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/components/scene/device-orientation-permission-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var DIALOG_OK_BUTTON_CLASS = 'a-dialog-ok-button';
2020
*/
2121
module.exports.Component = registerComponent('device-orientation-permission-ui', {
2222
schema: {
23-
enabled: {default: true},
23+
enabled: {default: false},
2424
deviceMotionMessage: {
2525
default: 'This immersive website requires access to your device motion sensors.'
2626
},

src/components/scene/xr-mode-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports.Component = registerComponent('xr-mode-ui', {
1818
dependencies: ['canvas'],
1919

2020
schema: {
21-
enabled: {default: true},
21+
enabled: {default: false},
2222
cardboardModeEnabled: {default: false},
2323
enterVRButton: {default: ''},
2424
enterVREnabled: {default: true},

src/core/scene/a-scene.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,6 @@ class AScene extends AEntity {
603603

604604
this.maxCanvasSize = {height: 1920, width: 1920};
605605

606-
// Use WebGL2 as long as it is available or the user specifies webgl2: false. Aframe-1.3.0
607-
// and later are also WebGL2 by default.
608-
let useWebGL2 = true;
609606
if (this.hasAttribute('renderer')) {
610607
rendererAttrString = this.getAttribute('renderer');
611608
rendererAttr = utils.styleParser.parse(rendererAttrString);
@@ -634,11 +631,6 @@ class AScene extends AEntity {
634631
rendererConfig.preserveDrawingBuffer = rendererAttr.preserveDrawingBuffer === 'true';
635632
}
636633

637-
if (rendererAttr.webgl2) {
638-
// If the user specifies 'renderer: "webgl2: false"' then we will use webgl 1.
639-
useWebGL2 = rendererAttr.webgl2 !== 'false';
640-
}
641-
642634
this.maxCanvasSize = {
643635
width: rendererAttr.maxCanvasWidth
644636
? parseInt(rendererAttr.maxCanvasWidth)

src/core/scene/metaTags.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ function Meta (attrs) {
2222
};
2323
}
2424

25+
function Link (attrs) {
26+
return {
27+
tagName: 'link',
28+
attributes: attrs,
29+
exists: function () { return document.querySelector('link[rel="' + attrs.rel + '"]'); }
30+
};
31+
}
32+
2533
/**
2634
* Injects the necessary metatags in the document for mobile support:
2735
* 1. Prevent the user to zoom in the document.

src/core/shader.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ Shader.prototype = {
5252
init: function (data) {
5353
this.attributes = this.initVariables(data, 'attribute');
5454
this.uniforms = this.initVariables(data, 'uniform');
55-
56-
// msdf and sdf use webgl2 by default during initialization. If we are using a WebGL1 renderer,
57-
// this will error. Therefore, switch to the WebGL1 shaders here for the shaders if we're
58-
// using WebGL1.
59-
if ((this.name === 'msdf' || this.name === 'sdf') &&
60-
this.el.sceneEl &&
61-
this.el.sceneEl.renderer &&
62-
this.el.sceneEl.renderer.isWebGL1Renderer) {
63-
this.vertexShader = this.vertexShaderWebGL1;
64-
this.fragmentShader = this.fragmentShaderWebGL1;
65-
}
66-
6755
this.material = new (this.raw ? THREE.RawShaderMaterial : THREE.ShaderMaterial)({
6856
// attributes: this.attributes,
6957
uniforms: this.uniforms,

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ require('./core/a-mixin');
9292
require('./extras/components/');
9393
require('./extras/primitives/');
9494

95-
console.log('A-Frame Version: 1.5.0 (Date 2023-12-12, Commit #fc54fe9a)');
95+
console.log('8-Frame Version: 1.5.0 (Date 2024-08-08, Commit #0ed964cd)');
9696
console.log('THREE Version (https://github.com/supermedium/three.js):',
9797
pkg.dependencies['super-three']);
9898
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);

src/shaders/shadow.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@ var registerShader = require('../core/shader').registerShader;
22
var THREE = require('../lib/three');
33

44
/**
5-
* AR shadow shader using THREE.ShadowMaterial.
5+
* Flat shader using THREE.ShadowMaterial.
66
*/
77
module.exports.Shader = registerShader('shadow', {
88
schema: {
9-
color: {type: 'color', default: 0x0},
10-
opacity: {default: 0.4, min: 0.0, max: 1.0}
9+
opacity: {default: 0.5},
10+
transparent: {default: true},
11+
alphaToCoverage: {default: true}
1112
},
1213

14+
/**
15+
* Initializes the shader.
16+
* Adds a reference from the scene to this entity as the camera.
17+
*/
1318
init: function (data) {
1419
this.material = new THREE.ShadowMaterial();
1520
},
1621

1722
update: function (data) {
1823
this.material.opacity = data.opacity;
19-
this.material.color.set(data.color);
20-
this.rendererSystem.applyColorCorrection(this.material.color);
24+
this.material.alphaToCoverage = data.alphaToCoverage;
25+
this.material.transparent = data.transparent;
2126
}
2227
});

src/systems/renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ module.exports.System = registerSystem('renderer', {
2424
sortTransparentObjects: {default: false},
2525
colorManagement: {default: true},
2626
alpha: {default: true},
27-
webgl2: {default: false},
2827
foveationLevel: {default: 1}
2928
},
3029

webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ module.exports = {
1313
devtool: 'source-map',
1414
mode: 'development',
1515
devServer: {
16-
port: process.env.PORT || 9000,
16+
port: process.env.PORT || 8080,
1717
hot: false,
1818
liveReload: true,
1919
static: {
2020
directory: 'examples'
21+
},
22+
headers: {
23+
'Access-Control-Allow-Origin': '*',
24+
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
25+
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
2126
}
2227
},
2328
plugins: [

0 commit comments

Comments
 (0)