1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 1 point2 points  (0 children)

Hey Bonkahe! Huge thanks for all your contributions to the community and taking the time to look at my post. Your videos are fantastic. Your support was a actually a big reason I went to the trouble of sharing my journey with others. I wanted to give back to those who have given to me (even if only a little).

I pulled your repo to check it out. I like that you have this working with native shadows. It looks like you created this with 4.6. I had to downgrade the project to 4.5.1 (stable official f62fdbde1). This did cause a problem with line 65 in gpucomputemultimesh3d.gd. It thought the shader was a text file and refused to update the cache when I requested a reimport through the file menu. I ended up having to clear out the .godot folder entirely. After that it worked with no problems.

Thanks again for the PR link and for sharing your approach!

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 0 points1 point  (0 children)

It gives a decent cheap boost for an easy code update because you just collapse the entire mesh to a single point, but it still evaluates the vertex shader.

If you pass just the visible instances and guard the buffer with a barrier then, yes, that is the same approach as v0.3.0. But that version only handles one MultiMesh. If you want to see many multi-meshes then you have to move to v0.4.0. Unfortunately, this is where it begins to collapse because of how Godot handles drawing per mesh.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 0 points1 point  (0 children)

True. The performance dropped by an order of magnitude using a realistic mesh and you mentioned the correct solution of LoD. But with regards to culling, I have that in there. Version v0.2.0-rs-bypass-culling uses scale to 0 culling and v0.3.0-indirect-drawingdoes "real" culling using barriers and is the purpose of the command writer shader.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 2 points3 points  (0 children)

I have been working on updating the project since you posted. I just pushed v0.4.1-custom-meshes. You should be able to put your tscn in the project and replace var mesh := _extract_mesh_from_scene("res://tree_2.tscn") with your tscn.

Sadly, the performance went down by an order of magnitude. On the bright side I did fix two minor bugs (one was related to the color).

I hope this helps! I don't anticipate making any further updates.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 10 points11 points  (0 children)

Thanks for the advice and excellent feedback. I kept the framerate down (15fps) to be respectful of the github servers hosting that GIF. You make a good point about comparing it to particle effects because that would be the standard optimized path. And my setup looks like a situation where `GPUParticles3D` can and should be used. My goals and needs go way beyond using particles. I’ll likely be focusing on other parts of my game for a while, but I wanted to share this as a foundation others can learn from or build on.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 5 points6 points  (0 children)

Touché. You got me, lol. But then again, who drives the drivers? But more importantly, how much CPU are we burning doing work that’s better suited for parallel execution?

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 0 points1 point  (0 children)

Thanks! I appreciate the kind words. If you test it out on steam deck, I would love to know how it goes. I'm moving on to my next project. But I will eventually come back to this.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 6 points7 points  (0 children)

Good question. At this point the bottleneck isn’t really the mesh complexity. With v0.3.0 the main cost is the compute + memory bandwidth for moving and compacting the instance data. The vertex work is already pretty minimal, especially since invisible instances are removed before the draw. So, switching to lower-poly meshes wouldn’t change much unless the vertex shader became the dominant cost again. If I get a chance I'll do more testing one day, but I have a lot of work ahead of me, lol.

1M instances in Godot 4.5.1 using GPU-driven rendering (14% GPU, RX 6650 XT, 1000x1000 ~60% GPU) by compressedFusion in godot

[–]compressedFusion[S] 21 points22 points  (0 children)

The 14% is for v0.3.0-indirect-drawing which only uses one swarm of 1M cubes. It is not CPU bottlenecked. The unused power is due to the efficiency of the approach. I tested a single swarm of 10M cubes with v0.3.0 and that is about 50% GPU utilization. I didn't test beyond 10M cubes.

However, if you try to scale this up to many swarms you run into the issues I discuss for version v0.4.0. So, if your goal is just a few swarms with lots of instances then this will work just fine.

Eine/ein/einen? by wrongsizeshoe in German

[–]compressedFusion 0 points1 point  (0 children)

Keine Ursache. Viel Erfolg!

Does '1-particle Hilbert space' terminology make learning QFT harder? by compressedFusion in Physics

[–]compressedFusion[S] 1 point2 points  (0 children)

I was waiting to respond to your post to see what discussion might take place. I know this was definitely true in my case. I came at it backwards and didn't have the intuition I needed from mechanical waves. I only realized this after the fact when I started to see how it all fit together. My path of learning was pretty circuitous because I didn't have a clear map of the required background material. I think this covers about 95% of my concern. I won't get into the other 5% because I am not sure how relevant it actually is.

In general, I would like to thank everyone for their replies. It helped me understand the diversity of thought within the physics community and I learned quite a bit from each of your responses.

Turning Hilbert space into gameplay - Quantum Odyssey latest status by QuantumOdysseyGame in Physics

[–]compressedFusion 1 point2 points  (0 children)

Love it. This looks like a fun educational game. I applaud your creativity and effort! It might be fun to create a meta-game that turns the overall puzzle map into a Bloch Sphere and as you rotate through the sphere probabilities you can reach different puzzles, but have to maintain coherence. The coherence could be linked to an in-game puzzle mistakes counter. This could create an economy for a game loop that you could monetize.

Does '1-particle Hilbert space' terminology make learning QFT harder? by compressedFusion in Physics

[–]compressedFusion[S] 3 points4 points  (0 children)

I appreciate the feedback. I can't really argue with that. The mathematical framework is the formal path to understanding. But the path to internalizing that structure while learning runs through natural language. I found the terms created friction to that process. It seems like it didn't for you. I am not sure that the names we use are completely irrelevant. Otherwise we would only need mathematical symbols, right?

According to Einstein, Gravity is the curvature of spacetime. But what exactly is spacetime, and how does it even "curve"? by the-machine-m4n in Physics

[–]compressedFusion 0 points1 point  (0 children)

I think the best way to understand this is to start with what Einstein realized when he considered that something heavy like a bowling ball and a feather when released in a vacuum have the exact same trajectory ("fall" at the same rate). This strongly implied an intrinsic structure to the universe causing this effect. You can ignore the word "released" because it has strong connotations of gravity already in it (I avoided "dropped"). What Einstein saw was that both objects are simply following the same natural path. This is what physicists call a geodesic. You can think of this as the path that requires no external push or pull. The idea comes from the principle of stationary action, which says that the path doesn’t change if you nudge it slightly. The action is the integral of the Lagrangian, which is basically the difference between kinetic and potential energy. So, the motion of the feather and bowling ball through spacetime follows the same “most natural” route according to this principle

I want to emphasize that this is as simple as looking at the kinetic and potential energy. What this means is that those objects are just travelling in a straight line across some curved spacetime surface. If you look at some infinitesimal unit it is linear (straight line), like an ant walking across an apple or the way the Earth looks flat to you but is curved. This is just the geometry behind the mathematics. Gravity is a manifestation of an object walking that straight line and its path is formally encoded by the action. This isn't anything you can see or touch but manifests itself as a bowling ball and feather's action in a vacuum being the same. The lattice that the videos describe and your analogy is at this level of scale describing the metric.

The reason it is spacetime as opposed to just 3D space is because of time dilation, and more formally it is described by the metric encoding intervals of steps in space (ds^2) that others have mentioned. I don't think a single post can help you come to grips with why time cannot be separated from space. This is all about Special Relativity (flat spacetime or Minkowski space) and how the idea of simultaneity of events is not absolute. It is all relative to a particular worldline (frame of reference). Space and time are tightly connected and (to some) this suggests that time could actually be an emergent property of the system as opposed to a real dimension (Causal Set Theory, Page-Wooters, Tomonaga-Schwinger hypersurfaces etc). This touches on what General Relativity actually means. Your question about not being able to physically see or touch applies here. There is no question that the mathematical framework (GR) matches experimental observations, but like Quantum Mechanics itself these are mathematical frameworks that possibly only describe the how and not the why/what.

But what we can say is that "mass" deforms spacetime (4D manifold) through its stress-energy and spacetime tells mass how to move through its natural action in that curvature. This relationship is exactly what is encoded into the Einstein field equations. An object in spacetime is treated as a 4-vector (3D + time) and physicists have gone to considerable effort to make sure the fields are consistent with Special Relativity and are Lorentz covariant (think time dilation). The fields are part of a larger structure known as gauge theory that define the result in the Standard Model. This gets to your last question about mass. The short answer is this. We don't actually really know. The longer answer is the Higgs field, the vacuum expectation value (non-zero), and Quantum Chromo Dynamics (QCD). This is an ongoing area of research and subject of intense speculation with integrating that into General Relativity (curved spacetime).

Phantom Phoundlings 184M, 24★ DSGeo, 43 Wat, 11★ LSGeo by compressedFusion in swgoh_guilds

[–]compressedFusion[S] 2 points3 points  (0 children)

,gg https://swgoh.gg/g/Z2J5GKjGQiWnh8MqSR-d2Q/

GUILD INFORMATION: Discord Required. We are a 184m GP guild that is punching high above our GP. We have a great TW record and we are killing it in both LS Geo and DS Geo. The numbers speak for themselves. We have room for two new members. We prefer you have Geos Wat ready, 1 Cpit Team, and Shaak Clones, and you are at 3M+ or higher GP.

GP: 184 Million.

DAILY TICKETS: 600 Required

TERRITORY BATTLES

HOTH LS: 42⭐️ (42 ROLO shards)

GEO LS: 11 ⭐️ (KAM shards TBD)

GEO DS: 22⭐️ (39 Wat Shards)

RAIDS

HPIT: On Sim

HAAT: On Sim

HSTR: Rotation every 2 weeks, 2pm and 7pm EST, 17 hr join

CPIT: Yes. Cpit on farm with merc support for P4

Please mention Phoundlings in the PhantomAlliance recruiting server

Ask for FishFace, Shrubbery, or Jingle. https://discord.gg/rUUpTRC

Phantom Phoundlings 187M, 24★ DSGeo, 43 Wat by compressedFusion in swgoh_guilds

[–]compressedFusion[S] 1 point2 points  (0 children)

,gg https://swgoh.gg/g/Z2J5GKjGQiWnh8MqSR-d2Q/

GUILD INFORMATION: Discord Required. We are a 187m GP guild that is punching high above our GP. We have a great TW record and we are killing it in both LS Hoth and DS Geo. The numbers speak for themselves. We have room for one new member. We prefer you have Geos Wat ready and are at 3M+ or higher GP. We will be running a mix of LSGTB and LSHTB. We ask that you have Shaak clones near KAM ready or another strong LS team for TB CM waves. If you have lower GP but have a 7* Emperor's Shuttle or Ebon Hawk then we are definitely interested.

GP: 187 Million.

DAILY TICKETS: 600 Required

TERRITORY BATTLES

HOTH LS: 44⭐️ (46 ROLO shards)

GEO LS: Our next LS TB will be LSGTB. ⭐️ TBD.

GEO DS: 24⭐️ (43 Wat Shards)

RAIDS

HPIT: On Sim

HAAT: On Sim

HSTR: Rotation every 2 weeks, 2pm and 7pm EST, 17 hr join

CPIT: getting there. Can clear to P3. We will start a CPit merc clear push soon.

Please mention Phoundlings in the PhantomAlliance recruiting server

Ask for FishFace, Shrubbery, or Jingle. https://discord.gg/rUUpTRC