LunarMotion
30 posts

LunarMotion
@lunarinteractiv
Freelance 3D artist and Web Developer
Leeds, England Katılım Haziran 2024
33 Takip Edilen2 Takipçiler

Noticing on my m1 air Chrome #webgl performance gets noticeably choppy whenever moving the cursor. Anyone else seeing this too? Try something smoothly animating e.g #webgl_geometry_cube" target="_blank" rel="nofollow noopener">threejs.org/examples/#webg…
Not a threejs issue, happens with my own engine too.
English

Doing some #webgpu tests at the moment. If you want to update a texture in a bindGroup do you have to generate the whole object again or is there a way to change single values?
English

@shatterspine The downside for me is ending up with a lot of rendering code is JS where you benifit from static typing the most. Unfortunate exposing apis directly to WASM hasn't materialised.
Interested to know more how you structure your sprite display list.
English
LunarMotion retweetledi

In the past I mostly discarded wasm as a real option to make use of while developing for browser games. But I think this came largely from me not seeing things from the right perspective - I think treating wasm as "a way to get some of your code to run fast" has issues.
For example, ideas like having your physics run in wasm exclusively might work but it also creates an additional layer of complication. Or doing specific math heavy steps such as updating transform matrices.
A common alternative: porting an entire c/c++ project plus rendering layer into wasm seems to have a lot of pitfalls as well. ("export to wasm"-type engines). Many projects created this way dont utilize browser tech well where it makes sense: lazy loading & really optimized WebGL rendering specifically written for the game. They often feel clunky for some reason.
Something I recently explored: you treat wasm as a "owns and modifies game state" device, and then never interact with it other than telling it "update(tick)" and sending it user input in a shared buffer. As output buffer, you get a list of visuals (meshes/sprites) that you display using webgl/canvas/webgpu, and a list of sounds to play. Culling, etc. is all done on the wasm end.
This way you reduce overhead from wasm calls, you keep all your internal game data inside a closed loop, and you treat javascript as a visualization / sound / input / event loop layer, nothing else - kind of like talking to a server.
Comes with advantages such as being able to re-use low level code to de/serialize data, having fast access to things like copying world states in memory - that take a long time in JS without re-inventing the wheel with arraybuffers.
Essentially, its really nice to develop multiplayer games that run in a browser and native on server.
Not saying that I think its the best way to do things, but it may be worth looking at for some devs, especially zig with decent ways to compile wasm.
Has anyone utilized this specific approach and got some experiences to share?

English

@shatterspine I agree - also WebGL and WebGPU functions often take JS obejcts as args which can be difficult to bind directly. Emscripten has to do so much code gen and shennanigans to make everything work. This way is has much less friction.
English

Brain has so many ideas for ray tracing structures after watching this. Probably stuff people have already thought of but this kind of curiosity led approach is very appealing.
Sebastian Lague@SebastianLague
I've been working on optimizing the ray tracer that I made a little while back. Here's a video about the process if you're interested! youtube.com/watch?v=C1H4zI…
English
LunarMotion retweetledi

I've been working on optimizing the ray tracer that I made a little while back. Here's a video about the process if you're interested! youtube.com/watch?v=C1H4zI…

YouTube
English

Trying a (wildly) different direction for portfolio site. This feels more me but I'll probably change my mind again before I'm done 😅
#b3d #blender #blender3d

English

Want to talk a bit about 3D scroll animations that are common today and how it's possible to improve them using some newer web APIs. 🧵
#webdev #webgl #blender3d
English




