Skip to content

Commit

Permalink
Move third party code to third_party
Browse files Browse the repository at this point in the history
  • Loading branch information
jsantell committed Jun 21, 2018
1 parent 1401668 commit 5486d0a
Show file tree
Hide file tree
Showing 72 changed files with 863 additions and 48,178 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/*
!node_modules/three/
**/*.sw*
.DS_Store
.idea
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ across different platforms.
## TODOs

* The DOM view is using post processing, but due to [WebGLRenderTargets not supporting antialiasing](https://github.com/mrdoob/three.js/issues/568), we get aliasing. Perhaps there are other solutions.
* three.js 94dev includes the `WebGLRenderer.prototype.setFramebuffer` function which we need in order to bind WebXR's framebuffer easily. This version is not yet in npm, so a local version is committed in node_modules/three, and some extra rollup work to work around this. Upgrade to r94 once its on npm. Currently an `npm install` blows this away (???). Non-ideal.
* three.js 94dev includes the `WebGLRenderer.prototype.setFramebuffer` function which we need in order to bind WebXR's framebuffer easily. This version is not yet in npm, so a local version is committed in third_party/three, and some extra rollup work to work around this. Upgrade to r94 once its on npm.
* There is currently no way to tell whether an iOS device has AR Quick Look support. Possibly check for other features added in Safari iOS 12 (like CSS font-display): https://css-tricks.com/font-display-masses/
* Since there are no USDZ three.js loaders (and seems that it'd be difficult to do), Safari iOS users would either need to load a poster image, or if they load the 3D model content before entering AR, they'd download both glTF and USDZ formats, which are already generally rather large.
* With native AR Quick Look, the entire image triggers an intent to the AR Quick Look. Currently in this component implementation, the user must click the AR button. Unclear if we want to change this, as interacting and moving the model could cause an AR Quick Look trigger.
Expand Down
62 changes: 32 additions & 30 deletions dist/xr-model-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -48063,15 +48063,15 @@ var fragment = ( copyFs$1 && copyFs ) || copyFs$1;



function CopyPass$1() {
function CopyPass() {
Pass_1.call(this);
this.setShader(vertex, fragment);
}

var CopyPass_1 = CopyPass$1;
var CopyPass_1 = CopyPass;

CopyPass$1.prototype = Object.create(Pass_1.prototype);
CopyPass$1.prototype.constructor = CopyPass$1;
CopyPass.prototype = Object.create(Pass_1.prototype);
CopyPass.prototype.constructor = CopyPass;

'use strict';

Expand Down Expand Up @@ -48159,7 +48159,7 @@ Stack.prototype.getPasses = function() {



function Composer$1(renderer, settings) {
function Composer(renderer, settings) {
var pixelRatio = renderer.getPixelRatio();

this.width = Math.floor(renderer.context.canvas.width / pixelRatio) || 1;
Expand Down Expand Up @@ -48199,9 +48199,9 @@ function Composer$1(renderer, settings) {
this.setSize(this.width, this.height);
}

var Composer_1 = Composer$1;
var Composer_1 = Composer;

Composer$1.prototype.swapBuffers = function() {
Composer.prototype.swapBuffers = function() {
this.output = this.write;
this.input = this.read;

Expand All @@ -48210,26 +48210,26 @@ Composer$1.prototype.swapBuffers = function() {
this.read = t;
};

Composer$1.prototype.render = function(scene, camera, keep, output) {
Composer.prototype.render = function(scene, camera, keep, output) {
if (keep) this.swapBuffers();
this.renderer.render(scene, camera, output ? output : this.write, true);
if (!output) this.swapBuffers();
};

Composer$1.prototype.toScreen = function() {
Composer.prototype.toScreen = function() {
this.quad.material = this.copyPass.shader;
this.quad.material.uniforms.tInput.value = this.read;
this.quad.material.uniforms.resolution.value.set(this.width, this.height);
this.renderer.render(this.scene, this.camera);
};

Composer$1.prototype.toTexture = function(t) {
Composer.prototype.toTexture = function(t) {
this.quad.material = this.copyPass.shader;
this.quad.material.uniforms.tInput.value = this.read;
this.renderer.render(this.scene, this.camera, t, false);
};

Composer$1.prototype.pass = function(pass) {
Composer.prototype.pass = function(pass) {
if (pass instanceof Stack_1) {
this.passStack(pass);
}
Expand All @@ -48253,27 +48253,27 @@ Composer$1.prototype.pass = function(pass) {
}
};

Composer$1.prototype.passStack = function(stack) {
Composer.prototype.passStack = function(stack) {
stack.getPasses().forEach(function(pass) {
this.pass(pass);
}.bind(this));
};

Composer$1.prototype.reset = function() {
Composer.prototype.reset = function() {
this.read = this.front;
this.write = this.back;
this.output = this.write;
this.input = this.read;
};

Composer$1.prototype.setSource = function(src) {
Composer.prototype.setSource = function(src) {
this.quad.material = this.copyPass.shader;
this.quad.material.uniforms.tInput.value = src;
this.renderer.render(this.scene, this.camera, this.write, true);
this.swapBuffers();
};

Composer$1.prototype.setSize = function(w, h) {
Composer.prototype.setSize = function(w, h) {
this.width = w;
this.height = h;

Expand All @@ -48286,9 +48286,9 @@ Composer$1.prototype.setSize = function(w, h) {

'use strict';

var Composer = Composer_1;
var CopyPass = CopyPass_1;
var BlendMode = {
var Composer$2 = Composer_1;
var CopyPass$1 = CopyPass_1;
var BlendMode$1 = {
Normal: 1,
Dissolve: 2, // UNAVAILABLE
Darken: 3,
Expand All @@ -48315,9 +48315,9 @@ var BlendMode = {
};

var wagner = {
Composer: Composer,
CopyPass: CopyPass,
BlendMode: BlendMode
Composer: Composer$2,
CopyPass: CopyPass$1,
BlendMode: BlendMode$1
};

var boxBlurFs = "varying vec2 vUv;uniform sampler2D tInput;uniform vec2 delta;uniform vec2 resolution;void main(){vec4 sum=vec4(0.);vec2 inc=delta/resolution;sum+=texture2D(tInput,(vUv-inc*4.))*0.051;sum+=texture2D(tInput,(vUv-inc*3.))*0.0918;sum+=texture2D(tInput,(vUv-inc*2.))*0.12245;sum+=texture2D(tInput,(vUv-inc*1.))*0.1531;sum+=texture2D(tInput,(vUv+inc*0.))*0.1633;sum+=texture2D(tInput,(vUv+inc*1.))*0.1531;sum+=texture2D(tInput,(vUv+inc*2.))*0.12245;sum+=texture2D(tInput,(vUv+inc*3.))*0.0918;sum+=texture2D(tInput,(vUv+inc*4.))*0.051;gl_FragColor=sum;}";
Expand Down Expand Up @@ -48502,7 +48502,7 @@ BrightnessContrastPass.prototype.run = function(composer) {



var BlendMode$1 = wagner.BlendMode;
var BlendMode = wagner.BlendMode;



Expand All @@ -48529,7 +48529,7 @@ function MultiPassBloomPass(options) {
this.params.zoomBlurStrength = options.zoomBlurStrength || 0.2;
this.params.useTexture = options.useTexture || false;
this.params.zoomBlurCenter = options.zoomBlurCenter || new THREE$1.Vector2(0.5, 0.5);
this.params.blendMode = options.blendMode || BlendMode$1.Screen;
this.params.blendMode = options.blendMode || BlendMode.Screen;
this.params.glowTexture = null;
}

Expand All @@ -48554,18 +48554,15 @@ MultiPassBloomPass.prototype.run = function(composer) {

this.blurPass.params.amount = this.params.blurAmount;
this.composer.pass(this.blurPass);

if (this.params.applyZoomBlur) {
this.zoomBlur.params.center.set(
this.params.zoomBlurCenter.x,
this.params.zoomBlurCenter.y
);
this.zoomBlur.params.center.set(0.5, 0.5);
this.zoomBlur.params.strength = this.params.zoomBlurStrength;
this.composer.pass(this.zoomBlur);
}

if (this.params.useTexture === true) {
this.blendPass.params.mode = BlendMode$1.Screen;
this.blendPass.params.mode = BlendMode.Screen;
this.blendPass.params.tInput = this.params.glowTexture;
composer.pass(this.blendPass);
}
Expand Down Expand Up @@ -49929,7 +49926,7 @@ class DOMModelView {
this.orbitCamera.position.z = 15;
this.orbitCamera.position.y = 5;

this.composer = new wagner.Composer(this.renderer);
this.composer = new Composer_1(this.renderer);
// Not sure why onBeforeRender doesn't exist, probably
// a dependency mismatch?
this.composer.scene.onBeforeRender = () => {};
Expand Down Expand Up @@ -50043,6 +50040,11 @@ class DOMModelView {
* limitations under the License.
*/

/**
* The Reticle class creates an object that repeatedly calls
* `xrSession.requestHitTest()` to render a ring along a found
* horizontal surface.
*/
class Reticle extends Object3D {
/**
* @param {XRSession} xrSession
Expand Down
21 changes: 0 additions & 21 deletions node_modules/three/LICENSE

This file was deleted.

86 changes: 0 additions & 86 deletions node_modules/three/README.md

This file was deleted.

Loading

0 comments on commit 5486d0a

Please sign in to comment.