Repository navigation
Give each fracture axis its own seed - #3
Draft
piexelated wants to merge 1 commit into
Draft
piexelated wants to merge 1 commit into
piexelated wants to merge 1 commit into
Conversation
- Warp the second and third axes with copies of the fracture reseeded by CNG.fractureAxisSeed, read at the same coordinates as the first axis, instead of reading the fracture at swapped coordinates - Add CNG.reseededForAxis, which caches the copies and drops them when the fracture changes - Shuffle the z axis of CellGenerator with reseeded copies of its noise - Compile the per-axis fracture reads as ordinary terms on their own nodes, so fractured programs stay on the native and GPU kernels - Rewrite the planar scalar chain for one term per axis and level, and drop the signed chain, which no program reaches anymore - Add CNGFractureMirrorTest and update the reference formulas and instrumentation of the fracture tests
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
CNG fractures warped the second axis by reading the same fracture noise at swapped coordinates, so every fractured style mirrored itself across x = z. CellGenerator's shuffle had the same swap. Each axis now gets its own reseeded fracture, read at unpermuted coordinates.
CNG.fractureAxisSeed(seed, axis)derives the seed. Axis 0 keeps the fracture's own seed, so the x warp is unchanged. Axes 1 and 2 use a splitmix64 mix, becauseseed + kwould collide withRNG.nextParallelRNG.fracture.reseededForAxis(axis)returns a cached copy rebuilt from that seed. Custom generators can't be rebuilt from a seed, so they get a seed-derived offset instead.Evidence
Same seeds and coordinates. Each badge is the share of pixels equal to their mirror across x = z. The grid's 65.5% on this branch is chance agreement, since most of its pixels are background.
CNGFractureMirrorTestfails on master, 780 of 780 sample pairs mirrored.After: it passes.
NoiseProgramParityTestpasses unchanged, and 79 of the 207 parity shapes stay native-backed, the same as master.util.noisetest classes pass on linux-x86_64, 164 tests.NoiseProgramBenchmark, median of 8 alternating master/branch pairs. The noise floor is ±4%.Merge Danger
Door: one-way
Fractured terrain changes for existing worlds, structure carve blobs and CellGenerator output included. There is no compatibility flag.
Blast Radius: worldgen
VolmitSoftware/Iris#1264 moves Iris to
CNG.fractureAxisSeedandCNG.reseededForAxis. It does not compile against VolmLib master, so merge this PR first. The Mac pin inNoiseSeedCohesionTestis still stale there. A CNG subclass that changes sampling must overridereseededForAxis, since its reseeded copy is a plain CNG.