mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
Volumetric surface terrain
- Add an optional per-biome `terrain3D` profile with density and fissure noise styles, amplitude, horizontal and vertical feature scales, crack depth, width and scale, slope and fluid-clearance gates, and a seed offset, each range-checked before use - Add a terrain runtime that samples the signed density and fissure fields on a four-block lattice around the biome's generated height and resolves each column into solid spans, so surfaces gain projecting rock, undercuts, ledges and narrow cracks that fade out on flat ground and near the fluid line - Remove unsupported rock by flood-filling span components across neighbouring columns and dropping any fragment of 512 blocks or fewer, while larger connected masses are kept - Report the shaped column top as the natural terrain height, keep the unshaped generator height available as a separate stream, and measure surface slope between neighbouring ledge floors instead of the flat heightmap - Write air through the gaps in the normal terrain actuator, generate a fresh surface palette for every ledge floor, and paint ceiling layers beneath undercuts - Carry each layer's own column through the dimension stack and upper dimension so stack top heights, solidity and surface lookups follow the spans, and each exposed face draws its palette from its own source height and slope - Sample a layer's slope condition once per column at the surface being generated, and gate surface decorators on the slope of the ledge they sit on rather than the column heightmap - Decorate every exposed ledge floor and the ceiling above it during the decorant pass - Treat shaped openings as surface rather than cave when resolving biomes, skip them during cave carving, suppress cave zone markers inside them, and resolve their boundary biome from the surface biome stream - Include shaped openings in mantle carve queries and carved columns, fall back to terrain solidity for surface-solid checks across stack, upper and normal terrain, and answer both queries from the island mask when placing objects on floating islands - Let the hydrology planned surface report whether it owns a column, so the cave voxel view consults natural terrain solidity where hydrology does not own the terrain, and split replayed plan observations into height and ownership records - Validate `terrain3D` on biomes and `snippet/terrain-3d` snippets as a blocking pack error, rejecting unknown fields, wrong types, out-of-range numbers, unknown noise styles, style nesting past 32 levels and snippet references that escape the pack - Copy the whole snippet tree during modded studio pack export through one shared routine instead of only `snippet/style`, so terrain and nested style snippets survive export - Add a terrain probe and Gradle task that generates real pack chunks, compares predicted column geometry against the actual blocks, requires retained overhang coverage for named biomes, reports detached-component topology, and writes cross-section images with a JSON summary - Enumerate image-mapped regions and skip compat-excluded ones when collecting biomes for stacked and upper dimension terrain
This commit is contained in:
+40
-1
@@ -13,6 +13,10 @@ String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
|
||||
.orElse('com.github.VolmitSoftware:VolmLib:master-SNAPSHOT')
|
||||
.get()
|
||||
|
||||
configurations {
|
||||
studioProbeApi
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(':core'))
|
||||
compileOnly(libs.spigot)
|
||||
@@ -36,6 +40,9 @@ dependencies {
|
||||
runtimeOnly(libs.oshi)
|
||||
runtimeOnly(libs.byteBuddy.core)
|
||||
runtimeOnly(libs.byteBuddy.agent)
|
||||
studioProbeApi(libs.spigot) {
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named('run', JavaExec).configure {
|
||||
@@ -84,6 +91,37 @@ Provider<String> probeJfr = providers.gradleProperty('probeJfr')
|
||||
Provider<String> probeTileX = providers.gradleProperty('probeTileX')
|
||||
Provider<String> probeTileZ = providers.gradleProperty('probeTileZ')
|
||||
Provider<String> probeOutput = providers.gradleProperty('probeOutput')
|
||||
Provider<String> probeStrictGeometry = providers.gradleProperty('probeStrictGeometry').orElse('false')
|
||||
|
||||
tasks.register('terrain3DProbe', JavaExec) {
|
||||
group = 'verification'
|
||||
description = 'Generates real pack chunks, verifies volumetric terrain spans and required biome overhang coverage, and exports actual block cross-sections.'
|
||||
mainClass = 'art.arcane.iris.probe.Terrain3DProbe'
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
jvmArgs('--add-modules', 'jdk.incubator.vector', '-Djava.awt.headless=true')
|
||||
dependsOn(':core:compileJava')
|
||||
doFirst {
|
||||
Map<String, Provider<String>> required = [
|
||||
probePack: probePack,
|
||||
probeDimension: probeDimension,
|
||||
probeSeed: probeSeed,
|
||||
probeMinimumChunkX: probeMinimumChunkX,
|
||||
probeMaximumChunkX: probeMaximumChunkX,
|
||||
probeMinimumChunkZ: probeMinimumChunkZ,
|
||||
probeMaximumChunkZ: probeMaximumChunkZ,
|
||||
probeRequiredCoverage: probeRequiredCoverage,
|
||||
probeOutput: probeOutput
|
||||
]
|
||||
required.each { String name, Provider<String> value ->
|
||||
if (!value.isPresent() || value.get().isBlank()) {
|
||||
throw new GradleException("terrain3DProbe requires -P${name}=<value>")
|
||||
}
|
||||
}
|
||||
args(probePack.get(), probeDimension.get(), probeSeed.get(), probeMinimumChunkX.get(),
|
||||
probeMaximumChunkX.get(), probeMinimumChunkZ.get(), probeMaximumChunkZ.get(),
|
||||
probeRequiredCoverage.get(), probeOutput.get(), probeStrictGeometry.get(), probeStudio.get())
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('genProbe', JavaExec) {
|
||||
group = 'verification'
|
||||
@@ -221,8 +259,9 @@ tasks.register('riverTransectProbe', JavaExec) {
|
||||
}
|
||||
}
|
||||
|
||||
['hydrologyProbe', 'genProbe', 'hydrologyPackProbe', 'generationOrderProbe', 'riverTransectProbe'].each { String taskName ->
|
||||
['hydrologyProbe', 'genProbe', 'hydrologyPackProbe', 'generationOrderProbe', 'riverTransectProbe', 'terrain3DProbe'].each { String taskName ->
|
||||
tasks.named(taskName, JavaExec).configure { JavaExec task ->
|
||||
classpath += configurations.studioProbeApi
|
||||
doFirst {
|
||||
if (probeJfr.isPresent()) {
|
||||
String requestedPath = probeJfr.get()
|
||||
|
||||
Reference in New Issue
Block a user