Opinion: Should I move to Unity or stay with Three.JS?

Hey everyone :slight_smile:

I’ve been coding completely on my own a social 3D world for the last year. It’s called 3.land. You can visit it, no need to sign up.

It is a social modern webapp connected to the Solana blockchain, it mixes 2D sites with 3D spaces (using Vue 3 for the UI, and Three.JS for the 3D part)

This is how the 2D part looks:


(We have a 3D viewer embedded here to show objects)

This is how the 3D+2D part looks:

Demo of virtual room with lights and glass materials:
https://dev.3.land/world/C4B4D4/28,0,16,78

As you can see there’s a lot of interaction that happens by switching from the 2D to the 3D parts, I can even drag stuff between windows or drop stuff to the 3D part.

HTML + 3D canvas interaction is pretty crucial.

I also run HTML as iFrames as 3D objects, to render websites within the worlds, for example, a YouTube video hung on wall.

Screenshot 2023-03-08 at 18.35.58
(This asdas.com thing is an embedded, interactive website)

In terms of size, the project is very optimized in every aspect, it’s entire JavaScript files weight around 10MB, including scripts that give WebXR support. 'Cause yeah, you can toggle VR view if you were visiting the website with a VR headset.

It also includes lots of NPM packages to do several stuff like, P2P video/voice calling, Socket.IO, ChartJS, Solana NPM packages, and many more.

Working with Three.JS has allowed me to incorporate very easily NPM package to any 3D process, accessing variables from my 3D part to the 2D part it’s a piece of cake. No need to expose anything.

Coding stuff from scratch has been my passion, it gives me a full understand of everything and how to optimize every part of code. That’s why I started by choosing Three.JS. It’s also literally WebGL, so no need to bundle/adapt stuff. As JavaScript and WebGL keeps evolving, Three.JS would evolve along with it. Three.JS is also 100% open-source, in contrary to Unity, its engine is not open-sourced… the stuff that is made with it could be.

Unity has plugins yes, but in my case I’d rather have NPM packages installed, since there are more options and gives you more control.

I also don’t wanna try to make a comparison myself between both engines, and would like to hear opinions, since I’d say I’m an expert on Three.JS compared to Unity (Have made stuff in Unity too, but not that much)

Why am I bringing this topic to this board?

Because, I’ve been asking myself if staying with Three.JS would make my path for scaling, harder or easier?

I’m looking to scale the product and the dev team.

Right now 3.land has worked perfectly, and I’d stay with Three.JS on a 100%, but I want an external opinion, since I could be biased.

So…

I’m very happy with how 3.land has been developed, and how cool its code has resulted. I don’t know if I gave enough information to familiarize readers with my perspective.

What would you do in this case? Would you stick with Three.JS and rock all of it’s features, or move to Unity and the world of no-code plugins.

2 Likes

Founder to founder here, I would stick with what is working for you right now. Also, there are a lot more developers being onboarded to Three.JS as we speak. you can take a look at Bruno Simons community for an example of that.

1 Like

It is hard for me to provide any meaningful advice, because I don’t use Unity at all and I don’t know all the ups and downs that you went through while building your project. In any case, a shift from one system to another requires additional efforts, as you may find yourself rewriting the same code again (and again, and again), but using a different API.

If I were to migrate my project from Three.js to another system, I will do it only if the other system has some very important functionality, that is missing in Three.js and is not likely to be implemented. If I am hesitant whether to move or not to move, I’d stay with Three.js.

You might consider asking the same question the Unity community. And then compare the answers there and the answers here.

1 Like

vue and three won’t scale. vue and unity won’t scale. the problem is neither vue nor three nor unity, the problem is that you’re pitting things together that have no relation, interop and integration. vue was made to describe views declaratively, three is imperative, it represents everything that vue set out to solve (on the dom), to sync the two in scale will collapse, it will get more and more complex until the app reaches a point where is fails.

instead of going unity, put vue aside and use this GitHub - pmndrs/react-three-fiber: 🇨🇭 A React renderer for Three.js and now you have a combined declarate environment with full interop and shared state. this is also the only thing in the threejs space that gives you an eco system, all the things you listed above are solved because people can pack their code into self contained components and share.

as an example, html sandwiched into the scene GitHub - pmndrs/drei: 🥉 useful helpers for react-three-fiber

there are a bunch of similar apps that use react + three, some that come to mind are flux.ai, colorful.app, bezel, sougen

3 Likes

ps there’s also https://tresjs.org and if react is not an option i would look into that. it’s new and there may be a risk. unlike react which was made cross platform from the get go, vue was made for the web, it had 5-6 failed attempts to make something like fiber but tres i think learned from past mistakes. though there’s still no eco system.

1 Like

It’s perfectly normal to have this kind of questions at some point when you are working on a long term project. Unless you are targeting other platforms you won’t get anything from Unity that can’t be done with ThreeJS, cause at the end of the day they both have to deal with the same Browser/Javascript limitations, and from this standpoint ThreeJS is by far the most optimized, performant and lightweight.

From what I’m seeing you’re more than half way, as most would advise you here, stick with what you have and continue the good work.

I respectfully disagree, I’ve been working with ThreeJS and Vue3 for the last three years, never had a problem, on the contrary, the more I use them, the more I learn, the more comfortable and capable I feel. There are a lot of good examples of Vue3/Threejs integrations out there, also an RTF like library ThreeJS + VueJS 3 + ViteJS.

I get your point, React Three Fiber and Drei are far more advance than any ThreeJS libraries/plugins right now. But for a project like this where you have to start from scratch and adapt any library to your needs, choosing React over Vue, Svelte or Solid… should be based on wish one you’re the most comfortable with, they’re all built to deal with Javascript and more than capable of fully integrating ThreeJS.

3 Likes

vue and threejs can indeed interop :c

1 Like

I wanted to test 3.land but freezes on “loading”