4 ms·
FYI, I recently posted about a 2d game I made, here: https://news.ycombinator.com/item?id=41761517 https://news.ycombinator.com/item?id=41761517 Putting aside
by dakom 2y ago
FYI, I recently posted about a 2d game I made, here: https://news.ycombinator.com/item?id=41761517 https://news.ycombinator.com/item?id=41761517
Putting aside the politics and all, focusing on the tech- one thing I came across when trying to do my own collision detection was the idea of using the GPU and occlusion queries for pixel-perfect results.
I didn't come up with the technique, but it's super cool, and since you're not taxing the GPU with tons of 3d triangles, it's perhaps a bit more free to do stuff like that.
- mococa 2y agoUsing the GPU is always interesting, although in my case I want to maintain compatibility with browsers through WebAssembly. Nowadays, it’s very rare for a user to download and run a binary.
- hedvig23 2y agoIgnorant question, but I assume that means there is no "browser-facing" or accessibility to the GPU for a web based application in this way (WebAssembled or even otherwise)?
- __m 2y agoThere is WebGPU, but support isn’t widespread yet. Compared to WebGL it does allow you to create compute “shaders”
- dakom 2y agoYeah, the game I linked to is in Rust/wasm, running solely in browsers :) The interesting part of the collision detection code is here: https://github.com/dakom/not-a-game/blob/main/src/collision/intersection.rs#L74 https://github.com/dakom/not-a-game/blob/main/src/collision/...