Open Zac8668 opened 10 months ago
My idea for the implementation is like this:
The problem with just adding a temperature field to the atoms is that if we want to update the temperature we would need to keep a lot of atoms "awake", that would drastically affect performance negatively.
But temperature spreading is not something that makes particles move, so we can probably use a compute shader to do that, that way we can make it awake only the particles that change state, and by having this separate simulation we can probably have some nice thermodynamics without damaging performance.
It would also spread temperature on a vast portion of the map without problems.
References: https://github.com/bevyengine/bevy/blob/main/examples/shader/compute_shader_game_of_life.rs
We can maybe also use a similar system to implement how fluids(gas/liquids) dissolve into each other. For that we would probably need each fluid atom to have unique properties that can be changed in runtime. We would probably have space for 4 properties, so that we can fit in a RGBA
Another resource: https://thermtest.com/what-is-thermal-conductivity
Thermodynamic simulation will be awesome! So that we can have rocks melt, water freeze, etc We probably want to add #52 first