7 ms·
React VR
- saosebastiao 10y agooh bloody hell...is this an elaborate troll? I get it...javascript is the universal language. It's also universally hard to fully understand, hard to scale to large codebases, has no shared memory parallelism, has a GC-heavy runtime, and is extremely hard to optimize for performance (both by humans and by compiler optimizers). I appreciate what React has done, it's pretty impressive. But I can't help but think we're getting into parody territory here.
- moondev 10y agoWhy does it matter in the least that its js? That's the beauty of react. It abstracts the ui from the renderer. Its the reason cool things like this can be built. I for one enjoy being able to build interfaces on a common platform for a multitude of application types.
- shawn-butler 10y agoHype
- stcredzero 10y agoYou seem to be implying that you have very excellent cross-platform reuse of code. Please tell me more.
- nkristoffersen 10y agoEven better, a unified skill set in the developer pool. Which is very valuable and productive.
- stcredzero 10y agoIs this really that valuable? Java and C++ had both provided this to some extent before. Rather, I think the majority of the power in Javascript tools comes from distribution. The distribution to both potential users and potential developers is unmatched, and those trump any technical deficiency in the language. I think if programming language designers should have learned anything in the past 50 years, it should be, "It's the distribution!"
- headcanon 10y agoSounds to me like you saw some jquery spaghetti 10 years ago, threw up your hands, and said "Never Again!" Seriously, its a lot better now, and if there's a thing you don't like about it (like static typing maybe?) there's something for you out there (typescript, clojurescript, elm, etc...)
- saosebastiao 10y agoI use React, and I use it with Typescript. So far it is the only thing I've found to be remotely tolerable for the web. There are better languages out there (I'd love to use scalajs), but even the best of them have noticable additional runtime overhead over the already ridiculous runtime overhead of javascript, and some of them go far beyond noticable. Maybe someday this will be better with WASM, but it's not there today. Javascript runtimes work fine (not perfect, but passable) for page-based and widget-based UIs. There's no way I would touch it for something as computation-intensive as real-time 3D modeling.
- headcanon 10y agoI'd imagine that this, like all the other 3D JS libraries, use WebGL under the hood, which is quite fast, hardware accelerated, and just exposes a JS API. You wouldn't actually write your shader in JS, unless it happened to be asm.js which allows the browser to get close to C level performance.
- iLoch 10y agoI don't think the other subcomments actually address your concerns, so here's my take: Javascript is the language known by every web developer. Right there, they're opening up their developer audience to a much larger group of people than is possible with C++ or even C#. "Hard to scale large codebases" isn't really an argument, large code bases are hard in every language, JS isn't really an exception here. Low level stuff (GC, perf, memory) has been, and will continue to be a problem for Javascript. You can mitigate a lot of the problems with well designed code. React attempts to minimize a lot of those problems with solutions that work for most general use cases (and now with Fiber, we're getting even more granular control.) Until React moves to Web Assembly you're always going to have overhead when using JS. But let me know when you've got a solution for VR in a web browser that's not JS and I'll give it a try.
- saosebastiao 10y agoAll of your comments are fair, although I'd dispute that some codebases are much harder to scale than others (x64 Assembly most definitely begs to differ), and javscript is most definitely one of the worst of the general purpose languages. But even then, as far as realistically cross-platform languages go, javascript is actually one of the best (wow). I happen to think though that the web is an obvious use case for the React model, and phone UIs are only slightly less obvious low hanging fruit that has worked out really well. The scalability of the model, however, depends on how much workload you can offload into the React system, and with VR, there is only so much you can do. Even if React is handling all of the rendering with extremely efficient native code, you still have to have a your own full 3d timespace model with realtime response demands. Maybe it will work for extremely basic use cases, but at some point having a familiar language becomes a relatively tiny benefit when compared to an efficient runtime.
- deleted 10y ago[deleted]
- yarper 10y ago> Right there, they're opening up their developer audience to a much larger group of people than is possible with C++ or even C#. Maybe this is true, but I'd hazard a guess that most developers are not web developers. [1] Most of us aren't questioning how VR can be done in a browser, but stopping to ask why. [1]: http://githut.info/ http://githut.info/
- agd 10y agoGarbage collection and compilation operations can cause hard to predict, noticeable slowdowns for large real-time JS apps so I'm skeptical of the use for ReactVR right now. Perhaps I'm wrong though? Or maybe it will be useful for static, UI scenes? Somebody convince me!
- iLoch 10y agoThe React team has been working on an improved rendering engine called Fiber. This is an oversimplification but Fiber essentially breaks down per-frame rendering into several sub rendering tasks, allowing for smarter multi-threading (in the case of web workers) and even single threading (the renderer now returns control of the main thread much faster and more frequently, allowing for more opportunities to do GC and other operations without as much of a negative effect.) An example of Fiber in action is here: https://www.youtube.com/watch?v=Qu_6ItnlDQg https://www.youtube.com/watch?v=Qu_6ItnlDQg What this amounts to for React developers is the introduction of explicit priority rendering, which can be very useful in VR environments. So for example, updates to your UI from external processes (such as an XHR) can be set to lower priority than updates to the hand model that's controlled by the controllers.
- fudged71 10y agoHow does this relate to garbage collection?
- kbenson 10y agoI think maybe the basic idea is that by utilizing more cores and getting more done concurrently, they leave more idle time per frame for the GC to work. If that's the case, it doesn't necessarily solve the problem, but it may move the bar enough to be currently usable and useful.
- moron4hire 10y agoAsynchronous Space Warp hides most sins. IDK how ReactVR does it, but Primrose pools most objects to avoid GC.
- HalcyonicStorm 10y agoSuddenly the snippet of code from Westworld makes sense
- stevens32 10y agoApparently hosts are built with React.. good to know.
- mumphster 10y agoAny reason this was built instead of contributing to aframe[0]? [0] https://aframe.io/ https://aframe.io/
- westoncb 10y agoOr Primrose[0]. [0]https://www.primrosevr.com/ https://www.primrosevr.com/
- mrspeaker 10y agoOr VRML? It's almost like we can have more than one thing!
- westoncb 10y agoMore than one is great—but ideally we'd have at least one which has reached a level of completeness, stability, desirability etc. to be a sort of standard people are happy with (again more than one such standard would be great). So if the tradeoff is completing a small amount or starting a larger amount, I'd rather have the small number of more complete options. I guess if you're already happy with VRML, you're set though ;)
- dragonwriter 10y agoVRML is pretty much not merely deprecated but actually obsoleted in favor of X3D/X3DOM.
- moron4hire 10y agoVRML was largely just 3D model format. WebVR is API-level access to VR hardware. WebVR frameworks are application frameworks that incorporate the ability to load many model formats, as well as provide different levels of configuration and convention.
- dmarcos 10y agoBoth A-Frame and VRML use an XML based approach to describe the scene graph but the similarities stop there. As someone mentioned, A-Frame is an entity component system that makes extensibility very easy. A-Frame is also not a standard but a JS library allowing us to iterate on the API much quicker and based on real world usage. With the lessons learned we might want to consolidate the API in a standard in the future. jQuery and its crystallization on the querySelector API is a precedent of this approach
- rayalez 10y agoJeeeeziz. HTML/JS were designed to display interlinked text documents. Now you can use them for VR. It's like building a spaceship out of bicycle parts. That's crazy. Crazy cool maybe, but definitely crazy. Love React by the way, will definitely check this out.
- lacker 10y agoI love the line "like building a spaceship out of bicycle parts". Maybe we should use that as React VR's slogan ;-)
- stcredzero 10y agoThat's a cool idea for a game. Maybe it could be done as a Kerbal mod? Have "etheric traction tires" provide inertialess drives?
- kbenson 10y agoI think Scrap Mechanic[1] may basically be this. I haven't played it, but my son had me buy it for him the other day. I'll be trying it out with him in a day or two. 1: http://www.scrapmechanic.com/ http://www.scrapmechanic.com/
- andreasklinger 10y ago+1 for making this your frontpage claim "…like building a spaceship out of bicycle parts" - HackerNews comment
- evan_ 10y agoThe first airplane was built from bicycle parts.
- return0 10y agoIt's not the first time (or the last). VRML worked in 1996 even
- avaer 10y ago
- borisyankov 10y agoFor anyone wondering: 'Why JavaScript? Why React?', let me remind you, the goal of ReactVR is not to create the most performant game, but to allow the people that are creating websites right now, to create VR websites in future. Using the same technologies is natural.
- javajosh 10y agoI would add that there is absolutely no technical reason why an application expressed in one language need not be as fast as an application expressed in another. First, compilers improve static analysis, and second, JIT analysis will also improve. For this sort of thing, running on the GPU matters a lot more than source language, and WebGL has you covered there.
- meheleventyone 10y agoIn the real world case though there are lots of extant technical reasons why this won't be as performant. As the parent says though it's okay for its usecase.
- positivecomment 10y agoIn the meanwhile many people like me who love TS/Flow wait for the days when their annotations could be used to optimize their apps. If types on JS doesn't come I'm sure someone will compile TS to WebAssembly or something. I'd be in even just for the possibility for reflection/dependency injection.
- Rusky 10y agoThis is wrong. There absolutely are technical reasons why implementations of different languages perform differently- no amount of static or runtime analysis can entirely save you from performance-hostile semantics baked into the language spec. WebGL is a huge bonus, but WebAssembly will also be important for a lot of web-based VR.
- 10y ago
- clintonb 10y agoIs this the return of VRML?
- lacker 10y agoWith a vengeance!
- daviding 10y agoI've used this for a couple of hobby projects and it's been fun. One thing I think it does need soon is a VR Browser for the Oculus Rift and/or Vive HMD's as well. Currently the use of the 'Carmel' VR browser is Gear VR only, and it would be nice to try some React VR on something with greater oomph.
- mncharity 10y agoDuring last year's absence of any WebVR or SteamVR support for linux and Vive, I cobbled together an alternate stack[0], using Valve's low-level OpenVR device driver, node.js electron as runtime and compositor, and a WebVR 1.0-ish api. I've used it with React and three.js. No ReactVR. No A-Frame. No lens correction. Insecure. The device driver api has moved on, and current device firmware may or may not work. But fyi, fwiw. [0] https://github.com/mncharity/node-webvr-alt-stack https://github.com/mncharity/node-webvr-alt-stack
- endergen 10y agoI'd love to see something like what Expo is doing for regular React Native for VR. Even them doing it would be great, I assume that might complicate their branding, but still. https://expo.io/ https://expo.io/
- Animats 10y agoDrawing pictures by writing code is pounding a screw.
- borisyankov 10y agoThere are tools for 'drawing pictures' already. From Google's Tilt Brush, to Oculus' Medium and Quill. And game engines start supporting scene editing directly in VR. This is not about pictures. This is about interactive websites in VR.
- suyash 10y agoThis is one project that has changed my mind to finally get going with facebook's React framework. I would love to see VR development more simplified and accessible to web developers.
- dmarcos 10y agoYou're more than welcome to also try http://aframe.io/ http://aframe.io/ That's exactly our goal, onboarding Web Developers into the new medium. Let us know what you think.
- komali2 10y agoAmber Roy will be giving a talk about this at the Google Downtown San Francisco office next Friday: https://www.meetup.com/sfhtml5/events/237831559/ https://www.meetup.com/sfhtml5/events/237831559/
- mullsork 10y agoWhat device would you recommend for playing with VR? I've never tried a headset but 3D UI interfaces has been something I've day dreamed about for well over a decade now and it'd be fun to see it happen. FWIW I'm on Linux & have an iPhone, if that matters.
- iamleppert 10y agoExtending VR to the web and to other sets of developers is great! However, I don't see any useful abstractions here besides a bunch of declarative boiler-plate. Creating something that allows more people access to a creative medium requires real abstraction, not just wrapping a bunch of Three.js API's in react components.
- jmcdiesel 10y agoAnd thus, VRML was reborn!!!!! Seriously, anyone remember VRML? It was so cool... it was technically junk and implemented horribly, but it was awesome still somehow. Like goat simulator.
- dangoldin 10y agoThat was one of my first forays into coding. I remember doing the basic examples and then finding some of legitimate worlds and having my mind blown. The good old days!
- Hydraulix989 10y agoReminds me of VRML.
- oelmekki 10y agoObvious question : is it plan at any point to support Unity3D?
- Shinchy 10y agoThis is awesome, however I just spent a month making the exact same thing. Oh well, I might give this a go and see if this is more in line with what I want to do.