Hacker News new | ask | show | jobs
by manuisin 40 days ago
Sounds good!

Yeah so I have no sophisticated tools, just guessed calculations done mostly at run time (add up how much do gpu compressed textures should take for a model, mesh+blendshape memory estimates, other data structures). And obv for audio and animations just ensuring what’s not needed is never in memory and just knowing how much the biggest ones cost. To come up with an estimate of an upper bound and obv with lots of testing. ios safari doesn’t even publicly expose how much memory usage is allowed to a tab (and it changes) so really the final test is that stuff stops crashing. But my testing put the crash window between 500mb-1gb on an iphone pro. over 1gb usually guarantees a crash. Not really enough to make a proper game by today’s standards but hey they shipped gta san andreas at 32mb ram on ps2 so I’m sure I can push things further.

To answer your webxr webgpu question, no, it still doesn’t mostly work. If you’re interested in reading up on it:

https://github.com/immersive-web/WebXR-WebGPU-Binding/blob/m...

Post by a Chrome dev: https://toji.dev/2025/03/03/experimenting-with-webgpu-in-web...

Webxr webgpu attempts iirc some advanced reprojection for increasing FPS that takes into account the depth buffer. And vision pro at least today has some nausea inducing bugs around that for at least the official immersive web examples hosted on github.io. so its better if a depth texture isn’t supplied today. the fallback reprojection works better more smoothly.

For the story stuff, I have similar things setup in my project to essentially reload the game at a certain point in the story but still I personally find HMR to be much faster wherever possible.

1 comments

> gta san andreas at 32mb ram

I forgot it was such a small budget, it's indeed important to keep in mind how much could be done with little memory. Although I'd argue it was possible with a language that allowed you to control memory very precisely. With javascript garbage collector, I couldn't stand seeing memory ramp up every frame due to threejs internals or my own js code, and every few frame a major GC may or may not lead to a frame drop.

> advanced reprojection for increasing FPS that takes into account the depth buffer

Ah got it. I completely forgot that webxr of course needs to create textures to see through, so it indeed needs to know which graphic api is used. Thank you for the links, I'll have to study them.

Same haha, it’s annoying to have those occasional frame hitches that are predictable but essentially unsolvable with three.js just cause GC causes them. and even the memory heap just feeling like a inscrutable black box and not even going down in size when one’s app is barely supposed to use any.