kikoano / web2vr

Dynamically translate HTML and CSS to A-Frame 3D world for virtual reality.
MIT License
129 stars 23 forks source link

Demo (and presumably repo) does not work with aframe 1.1.0 #5

Closed kylebakerio closed 3 years ago

kylebakerio commented 3 years ago

When putting the minimum demo from the repo's readme with aframe 1.1.0, it doesn't work.

This is an example with aframe 1.1.0 that produces the error seen below. This is an example with aframe 1.0.4.

2browser.js:111 core:schema:warn Unknown property `model` for component/system `generic-tracked-controller-controls`. 
web2vr.min.js:1 TypeError: Cannot read property 'listeningForMouseEvents' of undefined
    at o.value (web2vr.min.js:1)
    at t.value (web2vr.min.js:1)
    at web2vr.min.js:1

index.js:96 Uncaught TypeError: Cannot read property 'array' of undefined
    at TextGeometry.computeBoundingSphere (index.js:96)
    at P.raycast (three.js:8649)
    at ki (three.js:34685)
    at Ui.intersectObjects (three.js:34733)
    at i.checkIntersections (raycaster.js:227)
    at i.tock (raycaster.js:199)
    at HTMLElement.tock (a-scene.js:764)
    at e.object3D.onAfterRender (a-scene.js:53)
    at We.render (three.js:18659)
    at HTMLElement.render (a-scene.js:798)
kikoano commented 3 years ago

Working on update that it will work aframe 1.1.0. Aframe 1.1.0 broke some of my code including some webgl and three.js that i will need to rewrite myself.

kylebakerio commented 3 years ago

Glad to hear! I was excited to use this, but am experimenting with aframe-gui for now, though that library has a lot of limitations as well. I will definitely be keeping an eye on this project.

Bit of a sidetracked convo:

kikoano commented 3 years ago

Glad to hear! I was excited to use this, but am experimenting with aframe-gui for now, though that library has a lot of limitations as well. I will definitely be keeping an eye on this project.

Looks like the bug was fixed in the newest aframe master update. Do not use A-Frame version 1.1.0 it breaks Web2VR code. For now Web2VR 1.1.0 is only in developer version (dev branch) until A-Frame releases new version. The developer version is unstable and it uses this aframe master version. The 3 demo examples in the dev version have been updated to aframe master version.

Bit of a sidetracked convo:

  • Do you think of the primary use case for this as a way to design interfaces in VR?
  • If I want to display a 2d webpage within an A-Frame project and be able to interact with that page, do you think this is the ideal way to do so / is this project appropriate for that at all / do you know of any better options for that?

Yes I think being able to make or reuse html/css/js interface is good way to design interfaces both for VR and normal 3D worlds. I have seen other projects that try to translate web pages to web VR but all of them have so many limits. I got inspired from them to make a full big libarary.

kylebakerio commented 3 years ago

I see. Glitch here: https://deciduous-cooing-error.glitch.me/master-aframe

Do note that 1.1.0 was definitely a release, though: https://github.com/aframevr/aframe/releases/tag/v1.1.0

What's the story with the "clunky" borders around things? It's really a great looking library, but that's definitely the weakest link that stands out to someone checking it out right away.

kikoano commented 3 years ago

I see. Glitch here: https://deciduous-cooing-error.glitch.me/master-aframe

Do note that 1.1.0 was definitely a release, though: https://github.com/aframevr/aframe/releases/tag/v1.1.0

What's the story with the "clunky" borders around things? It's really a great looking library, but that's definitely the weakest link that stands out to someone checking it out right away.

Borders look fine on desktop browser with default border width but on mobile like Go/Quest they are really big because Go/Quest browser WebGL lineWidth (works unlike desktop) uses different value scale or something like that. On desktop browsers for now WebGL lineWidth is always 1 even if you change it. You can disable borders with border parameter.

kylebakerio commented 3 years ago

I've only been looking on desktop, they always are 'off', like a small square is cut out of the corners (or like the four border lines don't go quite far enough).

kikoano commented 3 years ago

Strange, I dont have that on chrome or firefox. Here is now it looks for me. You got that in the simple demo? Can you share screenshot and browser name.

kylebakerio commented 3 years ago

example-borders

kylebakerio commented 3 years ago

Chrome 86

kikoano commented 3 years ago

Really bizarre looks like its using WebGL lineWidth in some form, I think. Try see if it looks same on firefox. What OS are you using? I have tested it on multiple windows 10 computers and never got this.

kylebakerio commented 3 years ago

I'm on linux (pop OS 20.04, an ubuntu variation by system76)

kylebakerio commented 3 years ago

Looks correct (like your screenshot) in firefox

kikoano commented 3 years ago

I think I know why just tested on virtual ubuntu and got it. Will fix it as soon as possible in the dev version.

kylebakerio commented 3 years ago

This was the biggest turn off of the project for me from day 1 that I saw it months ago, btw. Makes a lot more sense now that you weren't aware, I assumed it was just because the project was in beta.

kikoano commented 3 years ago

Updated dev branch. Now borders work on any OS and on mobile VR like Oculus GO and Quest. Here is demo https://olivine-global-hip.glitch.me/ using newest aframe-master and dev branch.

kylebakerio commented 3 years ago

That works! Curious, what's the tl;dr on what the issue was?

kikoano commented 3 years ago

In component vr-border the LineBasicMaterial default linewidth was 10 (thats really width line) and while updating the material it was lineWidth and not linewidth how it supposed to be. This command linewidth that uses WebGL lineWidth() will always be 1 on windows by default because ANGLE rendering on windows uses DirectX (default but can be changed to GL) that does not support line width. While ANGLE rendering on other OS uses GL where it supports line width.