I'm impatient and the Demo for Danmaku3D (3D Touhou) is out 8 days early!

https://danmaku3d.xyz

Controls: Mouse to shoot, Spacebar to bomb, WASD to move, Shift to focus

Let me know if y’all find any bugs, and feel free to AMA!

Souce Code: GitHub - ChisatoSozo/danmaku3d-demo: Demo project for the Danmaku3D engine! (It’s pretty messy, gonna clean it for the next bit project with the same engine, also redo the engine in typescript)

I’d like to thank gl.fenceSync() for allowing this to even be possible

4 Likes

Really cool gameplay. How did you put so many particles on the screen while maintaining performance? I saw a hint at compute shaders. Also, it gets laggy at some point could probably be a bug.


Bullet positions are written to a float texture and updated every frame with a compute shader, then that texture is read by the vertex shader of the bullet material, to set the vericies of every mesh instance to where it’s supposed to be. Collisions are calculated with another computer shader using the result of the position shader as it’s input then the collision results are read back using async texture reading via a Pixel Buffer Object once per frame.

Let me know if that explanation was hard to follow, and I can elaborate on any part.

Also, the slowdowns I find happen when there’s straight up too many vertices on screen, because the bullets aren’t particles, they’re like 150 vertex meshes on the “high” graphics setting. For example, on Lunatic difficulty, the last boss attack is 362,880 bullets at once, multiplied by 150ish is 54,432,000 vertices. (I may have the math wrong on that one, that’s a larger number than I thought)

Its really weird that I know next to nothing in shaders. There is no point in getting technical. But I bet your implementation is really impressive

I highly recommend learning, they’re sooo fun ^-^

This is pretty cool, just looking at your code and I love your structure.

Thank you ^-^. Personally I’d like the engine bits to be separated from the game bits, but that’ll be for the full game

Wriggle is strong :smiley:

Seems like a good way to pass some geometry computation to GPU. Would be interesting to know more details :slight_smile:

Ask me anything you’d like to know ^-^. I’m willing to go as in depth as you’d like about any part of it!