-
Notifications
You must be signed in to change notification settings - Fork 294
BlockifyVR (Virtual Reality) #1732
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
base: master
Are you sure you want to change the base?
Conversation
that looks cool |
sadly i dont think that's possible to stop this. |
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. |
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. |
This comment was marked as resolved.
This comment was marked as resolved.
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? |
This comment was marked as resolved.
This comment was marked as resolved.
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 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* |
then how to use it ??? |
Hey, have u tried it on a vr |
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.
If it's not buggy anymore then you should try to get it to turbowarp
Hopefully it gets added |
I'll look at it soon |
My bad, I fell asleep yesterday once I got home, I'll look it over today if I don't crash out |
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.
First step of review while I'm at work
7. [Examples](#examples) | ||
|
||
## What This Is <a name="description"></a> | ||
__BlockifyVR__ is a cross-platform virtual reality extension designed to easily integrate into existing 3D projects. It targets modern <abbr title="six degrees of freedom; rotation and position" style="cursor: help; color: #2a7f62;">__6DOF__</abbr> virtual reality headsets with two 6DOF controllers. Its purpose is to provide a framework between virtual reality and Scratch for the creation of immersive games, experiences, animations, and more. |
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.
Refrain from using HTML elements inside your documentation, there's Markdown alternatives.
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.
Okay, so what kind of markdown alternative do you suggest for these hover-over definitions?
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 can't seem to find a similar alternative, but chatGPT suggests doing footnotes
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.
@CubesterYT There are no Markdown alternatives and Simple3D documentation has also been using those for a long time for the table of contents.
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.
@CubesterYT There are no Markdown alternatives and Simple3D documentation has also been using those for a long time for the table of contents.
Yes, the table of contents links are fine, but @CubesterYT was referring to the I used for the 6DOF hover definition
I also thought about doing
Press this to see more!
something like this with a summary in longer, more technical backend descriptions that might be helpful to more advanced users, which isn't supported in Markdown.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.
@CubesterYT the GitHub slash commands preview has the details block as an option:
<details><summary>Details</summary>
<p>
</p>
</details>
Surely we can make exceptions for this and links?
Nothing is fixing this issue 😭 but I did set the texture filter to nearest so it looks crisper now :) |
I'ma take a brain break for a week or so and come back in a bit |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Alright I've added a private commit that intercepts console logs and JS errors, then reports them back in Scratch blocks allowing me to "see" the console on the Quest. If there's no errors I'll be very upset and this will just have to be merged with a known visual glitch that can't seem to be fixed: it works perfectly on desktop and the scaling logic is sound.... But I'm expecting some kind of issue, if there's no errors reported then we have a problem, Houston |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Ya'll I fixed it just gotta clean up some things before I commit |
One last bug to fix for sure:
|
I'm going to try a few things to fix the last bug, mainly just deferring the texture assignment with requestAnimationFrame to attempt to prevent invalidation before the frame buffer is ready... Meanwhile, @CubesterYT I have a few questions before we do official reviews:
|
I've determined that this is incorrect and outdated information from a previous period of ignorance about how A-frame works @Xeltalliv the answer is yesn't. Yes and no. It's fairly complicated: A-frame has no way of knowing what kind of 3D engine the scratch project uses, so there's no true stereoscopy; the scratch stage only renders one view. However, the entire scratch stage is mirrored into A-frame at real time, and the A-frame renderer uses stereoscopy. This makes the flat texture on the flat plane have a very convincing illusion of depth, but it's "fake" stereoscopy. I was considering adding capabilities to the existing blocks to enable/disable A-frame's stereoscopy settings and return the projection/transformation matrices for the left and right eyes instead of the generalized camera, but quickly realized it would be unfeasible considering the ambiguity of the situation—how would it handle headsets with one display per eye (as with some modern headsets) rather than the traditional one-display two-lenses approach? How would a-frame use each project's unique stereoscopy implementation to render the correct view? Would it always be split down the middle, or would there be an alternate implementation? Simply plugging the stereoscopy directly into the project and having the project render two views might theoretically result in each eye having two views, which clearly wouldn't work, so I decided against it. Either way, I'm convinced most users would find the built-in stereoscopy solution compatible with any of their projects, easy to use, and convincing enough for most scenarios. While it doesn't handle complex and realistic depth scenarios (like putting your index finger up close to your nose and focusing on a faraway object so that your index finger appears to be seen double), in my testing it's enough that everything appears as expected and there's nothing jarring that would throw users off. |
Progress update and A RequestI've been working on various optimizations and bug fixes throughout the entire extension, along with preparing it for the final release. Over the past few months I've rearranged the extension structure to more closely follow A-frame's best practices, allowing me to fix a breaking issue and update past version 1.5.0 - it's now on the latest, which provides improvements for my workflow. Additionally, Meta/Oculus seems to have fixed an issue in their browser where the controllers wouldn't connect immediately upon entering VR, but only after pressing the system button. I don't know how other browsers on other platforms behave but overall this is an improvement. Yesterday I was working on a change to the design philosophy of display scaling. I added a "resolution scale" block (it only accepts values from 0.1-2.0) and refactored the system in the component to set the size of the scratch stage to the size of the renderer times the resolution scale, instead of dynamically deciding what to do based on what size is already present. This makes the scaling much more predictable, easier to understand, compatible with Augmented Reality, and behaves more as the users might expect—and the resolution scale block allows users to control the balance of quality and performance. @Xeltalliv and @CubesterYT However, there's two tiny issues that need addressing:
and wrapping the entire texture logic in a |
Sorry for writing an essay |
BlockifyVR
This is a Virtual Reality extension I've been working on since January 27th of 2023.
The end goal is to have:
Here are some things to note: