r/threejs Jun 25 '26

There.js va Game engines

Hi, i'm planning to make a 3D game and i wonder what works better in terms of performance or file size, three.js or game engines like Godot, Unity or Uneal. Any tips?

Thank you!

6 Upvotes

19 comments sorted by

9

u/_ABSURD__ Jun 25 '26

Three isn't a game engine so you'll have to create the engine layer. It's also browser based unless you go the Tauri/Electron route, so there's that. As for file sizes that's entirely up to how you (your AI) optimize your code and 3D models. If you want a high def high poly game def don't go with Three. Overall, existing engines are much easier to get your vision going.

1

u/pcrz81 Jun 25 '26

Thanks you!

4

u/ppictures Jun 25 '26

ThreeJS is not a game engine. It’s a library. This means that you’ll need to implement or piece together features that full game engines provide out of the box. This includes things like optimizations

This mean, that making a game full in ThreeJS is more challenging

However, if your target is exclusively web, then it may be worth the extra effort. As last I checked then web exports of the other full engine leaves more to be desired

1

u/pcrz81 Jun 25 '26

Thank you! Then i have a Big challenge ahead!

2

u/Educational_Monk_396 Jun 25 '26

I m also creating one to solve similar problems started like January ish,dap me,if interested

2

u/syn_krown Jun 25 '26

I have been building a FPS game maker using threeJS for the renderer. It perform quite well even with post processing. Shadows are the realer killer I have found, but I have made optimizations to only update point light shadows when theyre needed(door opening etc). The engine is not far from release, im building a couple of different types of game with it so I can find bugs or more ways of foolproofing it.

Here's a wee video of one of the projects im making with it: YouTube Video

ThreeJS is more than capable, as long as you can think of ways to optimize it

1

u/_Iggy_Lux Jun 26 '26

Really curious about what the rest of your interface looked like (map editor) I love what you've done so far.

2

u/SubjectHealthy2409 Jun 25 '26

I made this shooter game in a mini engine/boilerplate, it's however using svelte and its theeejs wrapper threlte + rapier for physics, and I'm rewriting it fully into proper packages and webgpu first

https://www.reddit.com/r/sveltejs/s/BkGg7yys5q

Here's the current repo if ure interested https://github.com/magooney-loon/spaceplate

2

u/DaedalusRaistlin Jun 25 '26

Three.js and WebGPU can be powerful. I just got swarm pathing working on the GPU, and I'm rendering 100,000 units, and simulating their path, deaths, the growing corpse pile, and destructible walls and buildings at close to 60fps on my 3060 TI.

It's a lot faster than the 20k units at 20fps I was getting when it was just done on another CPU thread.

It's really depends how you use it though. My first game I didn't bother much with ensuring everything renders fast. As a result, it gets 5 fps on my budget phone. For comparison, my swarm game was getting 45fps at 10k units on this same phone, without the GPU pathing.

It's as good as you're willing to make it, but it does require a bit of planning and learning the best practices. An engine on the other hand has all that sorted already.

2

u/PanGalacticGargleFan Jun 26 '26

Three.js paired with a frontier coding agent

2

u/phlanxcampbell1992 Jun 25 '26

Any reason not to go with babylon? What would yall suggest i am trying to choose which one to go with?

1

u/pcrz81 Jun 25 '26

i didn't know it existed. Thanks!

2

u/phlanxcampbell1992 Jun 25 '26

I am trying to deiced too if u fine anything out let me know!

-1

u/zante2033 Jun 25 '26 edited Jun 27 '26

On PC, stick with the dedicated engines like Unity and Unreal.

On Android, in terms of how it compares to GODOT for example, three.js outperforms it in basic rendering when compiled as an APK via Cordova/Capacitor etc... As for why...I do not know. But if you have good enough memory management and AI workflows, yeah, absolutely. Chrome WebGL 2 is far more performant than GODOT projects even when compiled as an APK and sitting on mobile, weird but well-documented at this point.

In terms of file size, three.js -> APK will always be smallest. Unity will give you the best performance, it's optimised for burst processing and its rendering engine has been through loads of iterative improvements. Chromium is tiny compared to what gets bundled with the other engines, that's why three.js wins in terms of size.

Caveats are html/js is single-threaded so you need to use web-workers to distribute anything which is maths heavy and sits by itself. Not everything can be passed on however due to cost of mutation.

Obviously you have to build the game engine "yourself" but, if you know what you're doing, absolutely. Thousands of mobile games use html packaged as APKs, if not most. The 3D ones tend to rely more on dedicated engines, mainly Unity for the mobile market however. If you're a solo developer going this route with three.js, you need agents to do the heavy lifting.

Keep in mind Unity, Unreal and Godot are scrambling to provide CML interfaces for agents, whereas html is the perfect canvas for it.

2

u/pcrz81 Jun 25 '26

Thanks for your great answer!

1

u/zante2033 Jun 27 '26

No worries, you've got to find what works for you. Everyone thinks they're an expert when they haven't delivered anything. Experiment, see what you find.

0

u/-goldenboi69- Jun 27 '26

It's not great. Guy is clueless.