r/gameenginedevs • • 7d ago

Snack Engine, A WebGpu Powered Game Engine

This is Pillow Cat running inside Snack Engine, A WebGpu powered game engine I’m building with TypeScript & Three.js,. I wanted a small game that would tell me where the engine still needs work. A hand hovering a little too far above a cat’s back is the kind of bug you can spot in half a second.

The petting code lives in the game project and uses the engine’s public JavaScript API. As you move the mouse, the game samples the surface of the cat’s back to angle the palm. Inverse kinematics makes the arm follow, and five contact points under the palm and fingers press and brush the fur. After a few seconds, “Purr Loading” fades in. Keep going for a minute and the cat starts purring.

13 Upvotes

14 comments sorted by

5

u/Icy-Collection1072 5d ago

Funny how people are coming with all these engines suddenly. Almost like ai is doing it for you

0

u/Gloomy-Detective-922 5d ago

Yes, development is ai accelerated, steered by domain experts.

3

u/CrazyWizard9835 4d ago

Honest question, what is the benefit of create a WebGPU engine versus the WebGL that everyone knows and is compatible with almost anything?

1

u/Gloomy-Detective-922 4d ago

Fair question, compatibility was my first hesitation too. Three main reasons I went with WebGPU on top of Three.js:

  1. Compute shaders. In WebGL you have to abuse render to texture ping pong hacks for GPU particles, fur simulation, or crowd updates. WebGPU gives you real compute passes cleanly.
  2. Much cleaner pipeline with lower CPU overhead. WebGL still drags around the old OpenGL global state model, which gets painful once you have lots of dynamic objects and animations on screen.
  3. You do not actually lose compatibility anymore. WebGPU support has matured fast across modern browsers, and Three.js WebGPURenderer with TSL can fall back to WebGL2 automatically on older hardware.

For a brand new engine I plan to maintain for years, building on WebGL first felt like starting on yesterday's ceiling.

1

u/Propagant 18h ago

how long have you been developing it?

0

u/Gloomy-Detective-922 18h ago

Almost 2 months in. Testing QA takes time

1

u/Propagant 17h ago

I pressume that it's mostly vibe coded then. What was your goal to make such engine? Why should I choose this instead of other industry standard engines?

1

u/Gloomy-Detective-922 16h ago

Calling it a vibe coded engine doesn’t justify the effort went into it. It’s a three js + webgpu engine. Its player and runtime is in bytes. Doesn’t eat memory as Unity or unreal does. I own the code, I can steer it towards any direction. You can call it AI accelerated development. Production grade engines cannot be vibe coded with single prompt. Atleast not now!

5

u/Many_Difficulty_490 7d ago

what if i want to beat the cat

2

u/Gloomy-Detective-922 7d ago

But why?

3

u/Many_Difficulty_490 7d ago

idk it was a bad joke

1

u/Beautiful_Stage5720 7d ago

Nah, I honestly laughed out loud

3

u/Many_Difficulty_490 7d ago

oh ok, i take it back then. it was a good joke

1

u/Gloomy-Detective-922 6d ago

Haha fair enough, I walked right into that one. Adding a scratch counterattack state machine would definitely be a fun physics stress test, though for now the cat stays strictly peaceful.