Four-layer ground: height-based blend, detail array and data map channels from the shader code #189
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!189
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/189/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-24 17:55 UTC · original
holdmysocks:claude/ground-height-blend→master· +22 −3 · 2 files · 5 commits · merged 2026-11-24 18:27 UTCSits on top of #187 (open): until that merges this PR's diff also shows its commits. Description only; no behaviour change in the exporter or the viewer.
Read
The main deferred pixel program of
standard_uber_4lyr_dpm_dm_hbb(the most used ground variant) for the height blend, and the tail of a layer block in the basestandard_uber_4lyrprogram for the detail array and the data map channels. Constants are named fromsixng shader-bindings.Height-based blend, now in
multilayer.height_blendas steps03754af2,b2339a6c) times the layer weight is normalised by the largest of the four, raised to an exponent20 - 19 * saturate((blendsoftness - 0.2) * 1.754), and renormalised.f24b51f2(0 or 1) mixes the result in:final = f * W + (1 - sum f * W) * w.Fit with the data
57 materials of that variant on 14 re-exported tiles:
f24b51f2is 0 on all four layers in 49 of them (no height blend at all),blendsoftnesslies between 0.4 and 0.75 (exponents about 13 to 2), the height scale is 1 in 55 and the offset 0 in 46.Also written down
detail_array: the shared texture array0cd27763is sampled once per layer; red and green are a detail normal, blue a brightness term.data_map_channels: B = height, A = tint mask, G = a roughness-like scalar (not confirmed), R not read.tint: what the shader does in words, and that the exporter does not apply it because several constant-selected branches are not resolved.Checked
cargo test -p sixng-core --lib: 178 passed (new assertions in the four-layer test). The full test command could not link its example programs on this machine today (out of memory in the linker), so only the library tests ran.Not read, not checked