Skip to content

Fixed 8frame 1.5.0 to include additional cherry picks and redo the commits made. #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
24f8dc2
Disable loading-screen by default
cmbartschat Feb 12, 2019
6cfab5e
Remove iOS PWA meta tags
cmbartschat Feb 12, 2019
9b90169
Wait for XR before play
cmbartschat Feb 12, 2019
4c8c203
Remove arrow function
cmbartschat Feb 12, 2019
5214d5e
Remove vr-mode-ui from scene defaults
cmbartschat Feb 12, 2019
10a2bc2
Tweak build process
cmbartschat Feb 6, 2020
3c0e47a
Add shadow shader to default shaders
cmbartschat Feb 25, 2019
1130db8
Remove deprecation warnings for XR8
cmbartschat Nov 26, 2019
a86b923
Automatically register xrweb component
cmbartschat Oct 29, 2019
7fe48da
Prevent error when registering xrweb twice
cmbartschat Nov 25, 2019
9bfc31d
Enable preserveDrawingBuffer by default
cmbartschat Feb 27, 2020
4ad0450
Patch WebGLRenderer to expose geometries and attributes
cmbartschat Feb 27, 2020
5af5a28
Fix missing resize
cmbartschat May 26, 2020
76dbfa5
Removing 'device-orientation-permission-ui' from default
NathanBWaters Feb 23, 2021
23510b3
Webgl version configurable and Webgl1 by default
NathanBWaters Feb 23, 2021
83eff75
Shaders use glsl based on renderer webgl version
NathanBWaters Feb 23, 2021
2474fa9
look-controls using 'deviceorientationpermissiongranted' event instea…
NathanBWaters Feb 23, 2021
f80b219
[8frame-1.3.0] Updating patch to super-three 137 with Oculus fix
NathanBWaters Apr 26, 2022
6be49cf
[aframe-1.4.1] Update threejs patch
Feb 13, 2023
d5bf6b6
[aframe-1.4.1] update npm run dist build process
Feb 13, 2023
6dacd58
[quality] Check for 'vr-mode-ui' on sceneEl before acccessing it (#45)
jparismorgan Feb 24, 2023
3dcd0ae
use WebGL2 by default
Apr 7, 2023
0ed964c
checkin 8frame dist
May 9, 2023
a3304f8
[1.5.0] Updated changes to the new 1.5.0 including only supporting we…
Aug 8, 2024
5b32697
[1.5.0] Bump build
Aug 8, 2024
b8625e9
Merge branch 'master' into 8frame-1.5.0-check
lmidang Aug 8, 2024
c4f89fc
Removed 1.4.1 builds
Aug 8, 2024
75351b5
Reverted webpack.config change
Aug 8, 2024
96c6d71
Revert README
Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dist/8frame-1.5.0.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/8frame-1.5.0.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/8frame-1.5.0.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/8frame-1.5.0.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "dist/aframe-master.js",
"scripts": {
"dev": "cross-env INSPECTOR_VERSION=dev webpack serve --port 8080",
"dist": "node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max",
"dist": "node scripts/updateVersionLog.js && node scripts/buildTo.js",
"dist:max": "webpack --config webpack.config.js",
"dist:min": "webpack --config webpack.prod.config.js",
"docs": "markserv --dir docs --port 9001",
Expand Down
15 changes: 15 additions & 0 deletions scripts/buildTo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var execSync = require('child_process').execSync;
var pkg = require('../package.json');

var name = process.argv[2] || '8frame-master';

console.log('Building 8frame as:', name);

const distMin = pkg.scripts['dist:min'] + ` --output-filename ${name}.min.js`;
const distMax = pkg.scripts['dist:max'] + ` --output-filename ${name}.js`;

console.log('>', distMin);
execSync(distMin, {stdio: 'inherit'});

console.log('>', distMax);
execSync(distMax, {stdio: 'inherit'});
4 changes: 2 additions & 2 deletions scripts/updateVersionLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const contents = fs.readFileSync('./src/index.js', 'utf-8');
const timestamp = getBuildTimestamp();
gitRev.short(hash => {
const newContents = contents.replace(
/console.log\('A-Frame Version:.*\)/,
`console.log('A-Frame Version: ${pkg.version} (Date ${timestamp}, Commit #${hash})')`);
/console.log\('8-Frame Version:.*\)/,
`console.log('8-Frame Version: ${pkg.version} (Date ${timestamp}, Commit #${hash})')`);
fs.writeFileSync('./src/index.js', newContents);
});

Expand Down
10 changes: 4 additions & 6 deletions src/components/look-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ module.exports.Component = registerComponent('look-controls', {
magicWindowControls = this.magicWindowControls = new THREE.DeviceOrientationControls(this.magicWindowObject);
if (typeof DeviceOrientationEvent !== 'undefined' && DeviceOrientationEvent.requestPermission) {
magicWindowControls.enabled = false;
if (this.el.sceneEl.components['device-orientation-permission-ui'].permissionGranted) {
// we removed 'device-orientation-permission-ui' as a default enabled component. This is
// a VR specific component.
this.el.sceneEl.addEventListener('deviceorientationpermissiongranted', function () {
magicWindowControls.enabled = data.magicWindowTrackingEnabled;
} else {
this.el.sceneEl.addEventListener('deviceorientationpermissiongranted', function () {
magicWindowControls.enabled = data.magicWindowTrackingEnabled;
});
}
});
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports.Component = registerComponent('material', {
material.opacity = data.opacity;
material.flatShading = data.flatShading;
material.side = parseSide(data.side);
material.transparent = data.transparent !== false || data.opacity < 1.0;
material.transparent = data.transparent !== false || data.opacity < 1.0 || data.shader === 'shadow';
material.vertexColors = data.vertexColorsEnabled;
material.visible = data.visible;
material.blending = parseBlending(data.blending);
Expand Down
5 changes: 5 additions & 0 deletions src/core/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,11 @@ module.exports.registerComponent = function (name, definition) {
});

if (components[name]) {
if (name === 'xrweb') {
warn('xrweb component is being registered multiple times.');
return components[name];
}

throw new Error('The component `' + name + '` has been already registered. ' +
'Check that you are not loading two versions of the same component ' +
'or two different components of the same name.');
Expand Down
23 changes: 13 additions & 10 deletions src/core/scene/a-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ class AScene extends AEntity {
this.setAttribute('inspector', '');
this.setAttribute('keyboard-shortcuts', '');
this.setAttribute('screenshot', '');
this.setAttribute('xr-mode-ui', '');
this.setAttribute('device-orientation-permission-ui', '');
super.connectedCallback();

// Renderer initialization
Expand Down Expand Up @@ -149,10 +147,9 @@ class AScene extends AEntity {
}

attachedCallbackPostCamera () {
var resize;
var self = this;

window.addEventListener('load', resize);
window.addEventListener('load', self.resize);
window.addEventListener('resize', function () {
// Workaround for a Webkit bug (https://bugs.webkit.org/show_bug.cgi?id=170595)
// where the window does not contain the correct viewport size
Expand All @@ -165,14 +162,15 @@ class AScene extends AEntity {
self.resize();
}
});
const onPlay = () => {
this.play();

function onPlay () {
self.play();

// Add to scene index.
scenes.push(this);
};
scenes.push(self);
}

window.XR ? onPlay() : window.addEventListener('xrloaded', onPlay);
window.XR8 ? onPlay() : window.addEventListener('xrloaded', onPlay);
}

/**
Expand Down Expand Up @@ -599,7 +597,8 @@ class AScene extends AEntity {
antialias: !isMobile,
canvas: this.canvas,
logarithmicDepthBuffer: false,
powerPreference: 'high-performance'
powerPreference: 'high-performance',
preserveDrawingBuffer: true
};

this.maxCanvasSize = {height: 1920, width: 1920};
Expand Down Expand Up @@ -628,6 +627,10 @@ class AScene extends AEntity {
rendererConfig.multiviewStereo = rendererAttr.multiviewStereo === 'true';
}

if (rendererAttr.preserveDrawingBuffer) {
rendererConfig.preserveDrawingBuffer = rendererAttr.preserveDrawingBuffer === 'true';
}

this.maxCanvasSize = {
width: rendererAttr.maxCanvasWidth
? parseInt(rendererAttr.maxCanvasWidth)
Expand Down
2 changes: 1 addition & 1 deletion src/core/scene/loadingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports.setup = function setup (el, getCanvasSize) {
var loaderAttribute = sceneEl.hasAttribute(ATTR_NAME) ? styleParser.parse(sceneEl.getAttribute(ATTR_NAME)) : undefined;
var dotsColor = loaderAttribute && loaderAttribute.dotsColor || 'white';
var backgroundColor = loaderAttribute && loaderAttribute.backgroundColor || '#24CAFF';
var loaderEnabled = loaderAttribute === undefined || loaderAttribute.enabled === 'true' || loaderAttribute.enabled === undefined; // true default
var loaderEnabled = loaderAttribute && (loaderAttribute.enabled === 'true' || loaderAttribute.enabled === undefined); // Disabled by default
var loaderScene;
var sphereGeometry;
var sphereMaterial;
Expand Down
4 changes: 1 addition & 3 deletions src/core/scene/metaTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ var MOBILE_HEAD_TAGS = module.exports.MOBILE_HEAD_TAGS = [

var MOBILE_IOS_HEAD_TAGS = [
// iOS-specific meta tags for fullscreen when pinning to homescreen.
Meta({name: 'apple-mobile-web-app-capable', content: 'yes'}),
Meta({name: 'apple-mobile-web-app-status-bar-style', content: 'black'}),
Link({rel: 'apple-touch-icon', href: 'https://aframe.io/images/aframe-logo-152.png'})
Meta({name: 'apple-mobile-web-app-capable', content: 'no'})
];

function Meta (attrs) {
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ require('./core/a-mixin');
require('./extras/components/');
require('./extras/primitives/');

console.log('A-Frame Version: 1.5.0 (Date 2024-08-06, Commit #80e4b39a)');
console.log('8-Frame Version: 1.5.0 (Date 2024-08-08, Commit #0ed964cd)');
console.log('THREE Version (https://github.com/supermedium/three.js):',
pkg.dependencies['super-three']);
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
Expand Down Expand Up @@ -123,3 +123,8 @@ module.exports = window.AFRAME = {
utils: utils,
version: pkg.version
};

// If 8frame loads after XR8, manually register the component
if (window.XR8) {
window.AFRAME.registerComponent('xrweb', window.XR8.AFrame.xrwebComponent());
}
4 changes: 3 additions & 1 deletion src/utils/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ if (isWebXRAvailable) {
return;
}
if (sceneEl.hasLoaded) {
sceneEl.components['xr-mode-ui'].updateEnterInterfaces();
if (sceneEl.components['xr-mode-ui']) {
sceneEl.components['xr-mode-ui'].updateEnterInterfaces();
}
} else {
sceneEl.addEventListener('loaded', updateEnterInterfaces);
}
Expand Down
Loading