Fix mushroom cloud being clipped by simulation grid - #2
Open
FraGGerSheep wants to merge 2 commits into
Open
Conversation
The MarchingCubes grid was a 12×12×12 cube centered at Y=0, so the simulation space ran from Y=-6 to Y=+6. The explosion injection at N*0.12 mapped to world Y≈-4.5 (underground), and the rising cloud hit the ceiling at Y=+6 where _setBoundary zeroed its density, literally clipping the mushroom cap. - Switch MC to a tall non-square box (16 wide × 40 high), shifted up so the grid bottom sits at ground level and the cap has headroom. - Open top boundary on density/temp so gas flows out instead of being killed at the ceiling. - Add entrainment force that pulls low-altitude gas toward the central axis, forming a narrow rising stem. - Tune vortex ring to form higher (52-74% of grid height) and wider for a recognizable mushroom cap. - Lower buoyancy and initial velocity so gas rises steadily rather than rocketing into the boundary. - Reframe the camera and tracking target to follow the cap up to world Y≈28, and thin the fog so the top stays visible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The mushroom cloud was being cut off at the top because the MarchingCubes grid was a 12×12×12 cube centered at Y=0, so the simulation only ran from world Y=-6 to Y=+6. The explosion injection at
N*0.12mapped to world Y≈-4.5 (underground!), and as the cloud rose it hit the ceiling at Y=+6 where_setBoundaryzeroed its density — literally clipping the cap.This PR retunes the simulation volume and the cloud dynamics so the full mushroom shape — narrow stem, wide cap, headroom above — actually fits and reads as an atomic mushroom.
What changed
mc.scale.set(8, 20, 8)+position.set(0, 20, 0)→ world Y now spans 0→40 with the grid bottom at ground level.FluidSolver.step(): density and temp atj=N-1copy fromj=N-2(with mild attenuation) instead of being zeroed, so gas flows out rather than getting killed at the ceiling._addForces: low-altitude gas gets pulled toward the central axis, producing a narrow rising stem.buoyancyAlpha(max 5 instead of 10) and lower initialvy(2.0 instead of 3.0) so gas no longer rockets straight into the boundary.Test plan
npm run devand watch a full detonation cycle — cap should clearly form above a visible stem and not visibly clip against the top of the simulation🤖 Generated with Claude Code