-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add YouTube Equi-Angular Cubemap (EAC) projection #179
Conversation
|
||
this.movieGeometry = new THREE.BufferGeometry().fromGeometry(geometry); | ||
this.movieMaterial = new THREE.MeshBasicMaterial({ map: this.videoTexture, overdraw: true, side: THREE.BackSide }); | ||
|
||
this.movieScreen = new THREE.Mesh(this.movieGeometry, this.movieMaterial); | ||
this.movieScreen.rotation.y = -Math.PI / 2; | ||
this.movieScreen.scale.x = -1; | ||
this.movieScreen.quaternion.setFromAxisAngle({x: 0, y: 1, z: 0}, -Math.PI / 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these changes do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from 360
projection. This transforms the geometry so that it maps the texture correctly. The geometry is rotated by pi/2 and flipped.
The version on master is completely broken, resulting in a blank canvas, IIRC. You can test that with a 360_LR or 360_TB video.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can test that with a 360_LR or 360_TB video.
coriolis_rect.webm
is one ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need more than one eac example video in the repo?
package.json
Outdated
@@ -82,6 +82,7 @@ | |||
}, | |||
"dependencies": { | |||
"global": "^4.3.2", | |||
"natives": "^1.1.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I had some build failure at some point. Don't remember what exactly. I'll revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted during rebase.
Edit: Uh, didn't happen. Now it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think https://travis-ci.org/videojs/videojs-vr/builds/575075840 is the build failure.
21 08 2019 21:50:35.760:ERROR [config]: Invalid config file!
ReferenceError: internalBinding is not defined
at internal/util/inspect.js:31:15
at req_ (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:140:5)
at require (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:113:12)
at util.js:25:21
at req_ (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:140:5)
at require (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:113:12)
at fs.js:42:21
at req_ (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:140:5)
at Object.req [as require] (/home/travis/build/videojs/videojs-vr/node_modules/natives/index.js:54:10)
at Object.<anonymous> (/home/travis/build/videojs/videojs-vr/node_modules/unzip/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
This is to demonstrate LR rendering capabilities. I can remove that if you want; however, not having an example for LR 360 could be an indirect cause of its failure IMO. |
Where do the new sample videos come from? |
YouTube, downloaded via I'm pretty sure they were downloaded using format code Had to find some 360 videos that isn't too long or too short and is explicitly allowing reuse. |
Cool, I can see that both are creative commons licensed, so, shouldn't be a problem to include in the repo. |
YouTube has been using this projection since 2018 (see ytdl-org/youtube-dl#15267), and most YouTube downloaders will get EAC format when attempting to retrieve YouTube 360° videos. This patch adds ability to render videos in this projection. Formulas for the shader are derived from Google's blog [1], and pixel truncation done by trial and error with a bit of pixel inspection on a single frame of a downloaded video. Without turncating the pixels, seams appear on cube borders where the textures are discontinuous. Two videos downloaded from YouTube, in both EAC projection and Equirectangular projection, has been added to the repo, along with relevant HTMLs to demonstrate the rendering. During the testing I found that split Equirectangular projection to not render at all, and that has been fixed along with this patch. [1] https://blog.google/products/google-ar-vr/bringing-pixels-front-and-center-vr-video/
I reverted the changes to package-lock.json as well. |
+1 following |
Description
YouTube has been using this projection since 2018 (see
ytdl-org/youtube-dl#15267), and most YouTube downloaders will get
EAC format when attempting to retrieve YouTube 360° videos. This
patch adds ability to render videos in this projection. Formulas
for the shader are derived from Google's blog [1], and pixel
truncation done by trial and error with a bit of pixel inspection
on a single frame of a downloaded video. Without turncating the
pixels, seams appear on cube borders where the textures are
discontinuous.
Two videos downloaded from YouTube, in both EAC projection and
Equirectangular projection, has been added to the repo, along with
relevant HTMLs to demonstrate the rendering. During the testing I
found that split Equirectangular projection to not render at all,
and that has been fixed along with this patch.
[1] https://blog.google/products/google-ar-vr/bringing-pixels-front-and-center-vr-video/
Specific Changes proposed
Requirements Checklist