BlockifyVR (Virtual Reality)
BlockifyVR
This is a Virtual Reality extension I've been working on since January 27th of 2023.
The end goal is to have:
- [x] Little to no performance overhead with the extension
- [x] Cross-platform compatibility for all major 6DOF headsets A-frame supports
- [x] An easy-to-use system that's coherent and efficient
- [x] Works well with any 3D engine
- [ ] Bug-free enough for optimal user experience without frequent disruptions
Here are some things to note:
- It includes a local copy of the A-frame JS library, version 1.7.0, MIT License. This is for VR Management, rendering, and ease of development as I'd have to write the entire thing from scratch using WebXR, WebGL, and the Gamepad API otherwise. Setting up the VR boilerplate and stereoscopy and other things would be a pain without it.
- Gallery thumbnail, documentation, and sample projects are not currently available and will be worked on as I get nearer towards release
- The rendering uses a plane fixed to the camera which directly mirrors the scratch stage with an unshaded texture each frame. This is relatively performant and works well, but there could be better solutions to look into. The plane is placed 1 meter away from the camera and A-frame uses stereoscopic rendering to reduce eye strain. Note that the plane automatically scales to the size of the camera (display) while attempting to maintain the ratio of the stage. I use this instead of drawing directly to the canvas because it won't let me and I would have to re-write the renderer that's already tailored for VR
that looks cool
that looks cool
It looks cool on the flat screen right now, but it's not so great when you try it. You'd probably get motion sickness. I'm still working on it.
sadly i dont think that's possible to stop this.
Does this show the same scratch 3D perspective to both eyes?
Does this show the same scratch 3D perspective to both eyes?
A-frame has stereoscopic rendering built in and I've enabled it in the rendering settings, so no. This fixes some issues with visualizing depth, so the eye offset allows your brain to process the image with more clarity. Even if the matrices aren't used in the renderer, it should properly use the correct eye offset. Why do you ask, just out of curiosity? If you'd like I could add a block that disables or enables this feature, in case the Scratcher wants to build that framework themselves, which I'd doubt.
Keep in mind this is still a work in progress and most of the code is many months old so it's not the most efficient way to do VR.
Why do you ask, just out of curiosity?
Yes. At one point I tried to extend my AR extension to support AR headsets and VR as well, but the multiple eye rendering has been the main thing holding me back. I was just curious to know how you solved it.
Why do you ask, just out of curiosity?
Yes. At one point I tried to extend my AR extension to support AR headsets and VR as well, but the multiple eye rendering has been the main thing holding me back. I was just curious to know how you solved it.
I believe that there can be two XRViewerPose matrices for each eye if available, according to Mozilla Docs. You might want to look into that again. It'd be great if Augmented Reality could support AR headsets such as the Oculus Quest 3 in addition to just mobile touchscreen devices. There should be a views array that can do this. An example can be seen here. Just a suggestion though. I simply think having AR headsets would be a nice update.
@Xeltalliv Your extensions are good quality and you seem to know what you're doing with WebXR.
I've looked at the code like 100 times. Do you mind taking a peek at the left-controller-manager and right-controller-manager A-frame components? Pressing any button significantly drops the FPS even without calling the event hat block. Additionally, pressing any button on the right controller returns its left controller counterparts except for X, Y, A, and B on Oculus Quest.
Just asking for another pair of eyes, that's all. I've asked other developers I know and I've asked ChatGPT and I've referenced the A-frame docs and everything looks fine to me, I just can't narrow down the issue.
I'll take a look when I have time. Thought it will probably be hard because the only kind of VR I have access to is phone-based 3DOF no controller VR.
Also, do you mind giving some links, so that I can faster figure out where to look?
I'll take a look when I have time. Thought it will probably be hard because the only kinf of VR I have access to is phone-based 3DOF no controller VR.
Also, do you mind giving some links, so that I can faster figure out where to look?
Ok, no problem! I wasn't asking you to test the extension, and Google Cardboard-like devices aren't supported by it anyway, so you're fine, don't worry about it.
As for the links, do you mean the XRViewerPose Mozilla Developer Docs links or the links to my controller code? Because as of right now the latest version of my extension is only available on private GitHub repo accessible only to me. You could always just view the added BlockifyVR.js commit here and scroll down to the [hand]-controller-component blocks of code. Just a note though, it does include the entire minified A-frame library, so it might lag your browser a bit.
I'll take a look when I have time. Thought it will probably be hard because the only kinf of VR I have access to is phone-based 3DOF no controller VR.
Also, do you mind giving some links, so that I can faster figure out where to look?
As for VR testing, you wouldn't really need a VR headset. I've used Meta Quest's Immersive Web Emulator extension for testing when I didn't care to load up the entire headset.
ah yes, I remember seeing a trailer for this on scratch. I wanted to help, but now I can't
nvm I think I can i'm Martinelplayz on scratch btw
I'll take a look when I have time.
I took a look and have no idea. It's all code specific to AFRAME. I don't know AFRAME. AFRAME is too big and complicated for me to try to debug, especially if the only tool in my disposal is WebXR API Emulator browser extension.
Nic3
Nice*
uld i try the extension?
Let's say no. to
then how to use it ???
Hey, have u tried it on a vr
If it's not buggy anymore then you should try to get it to turbowarp
You're going to have to be patient. Please refer to this comment to see the planned release schedule.
It's still significantly buggy and it will be a few months before I submit this for review, and possibly many more after that before it's on the gallery.
Hopefully it gets added
Btw how do I use the extension
uld i try the extension?
Let's say no. to
then how to use it ???
You're not supposed to use it until it's finished. Right now it doesn't work well.
why
uld i try the extension?
Let's say no. to
then how to use it ???
You're not supposed to use it until it's finished. Right now it doesn't work well.
why
He said "right now it doesn't work well"
uld i try the extension?
Let's say no. to
then how to use it ???
You're not supposed to use it until it's finished. Right now it doesn't work well.
why
He said "right now it doesn't work well"
To both @Thebloxers998 and @siskka7,
I understand that you both would very much like to use my extension as soon as possible. However, I plead for your patience. These kinds of things (specifically anything related to VR) are very difficult to develop and take much longer than normal projects. I have determined from extensive testing on a VR headset that this extension is not under any circumstances ready for use at the moment. I appreciate your desire, but again, I don't want to be the cause of any motion sickness, physical discomfort, etc. that may come from the premature use of this extension - it is simply too unoptimized and too buggy to be used in its current state.
With that said, I'm aware that many people are looking forward to using this extension, so I will try to develop this extension as fast as I can - so long as it's not unhealthy; I still have a life to attend. You can expect this PR to be opened from a draft to "ready for review" in the coming months.
Thank you for understanding.
Well I could give you an idea for the extension
Well I could give you an idea for the extension
I'd be open to suggestions, but please make sure it isn't already on the upcoming release plan.
What if you add a "Experimental" section where there are blocks that are for testing and when you try to trigger a block in the section it will first alert you that these are only for testing and then it lets you trigger it
And it will also tell you that it doesn't recommend it because it may cause lag
What about a boolean that detects if your vr is stable
(Sorry, i dont know alot about vr)
And operators that check body part's XYZ position
What about a boolean that detects if your vr is stable
It's not about the hardware, it's about the state of the extension itself.
Sorry I ment unstable and I'm talking about if it's lagging or not
And a button that let's you do suggestions and stuff?
And a button that let's you do suggestions and stuff?
I'm not sure what you mean by that.
Oh I mean like a button like the Open Documentation one