Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

fix(visual): Task 6 review round 1: a depth-cue haze, warmer ground, an uncompressed AO and a single-precision graph

eyalgolan78e540091b64
diff --git a/docs/visual-v1.md b/docs/visual-v1.md
index ebaf71aca..0e3317765 100644
--- a/docs/visual-v1.md
+++ b/docs/visual-v1.md
@@ -100,8 +100,29 @@ Against the Task 1 baseline (`all`): gameplay03 2.29 -> 1.58 ms, diorama02 6.84
the spread). Haze costs nothing measurable (`all` - `-haze`: -0.30 / +0.12 ms, both inside the spreads). The boot phase
`biome texture baked` takes 94-106 ms (it replaces Task 1's `biome colours blended`).
+### Task 6 fix round 1
+Haze retuned (review I1: start 200 km, scale 250 km, max 0.45, rift boost 0.6, colour sRGB (0.84, 0.74, 0.58)), ground
+palette x1.107 in sRGB, curvature gain 0.40, graph and nodes at Single precision, HDRP target dropped, trilinear map
+textures (bake aniso 2), the fine noise octave faded by its pixel footprint. The AO is its own uncompressed R8 texture
+(`ao.png`): measured against the source PNG, BC1 stepped it by 2+ levels on 404 of 681 broad Judean texels (59%); R8
+gives 0 of 681 (Judean slopes) and 0 of 6206 (Negev plateau). WebGL build: 76.9 MB (+3.5 MB for `ao.png`), no
+`Shader error`. GLES3 report (with vis-light `e8b1c48`'s serialized-subshader loop): 0 errors and no `require` for
+`Statecraft/StatecraftTerrain`, `Statecraft/HexSelection`, URP Lit (the sea on this branch) and URP Terrain Lit.
+
+| Run | Lines |
+|---|---|
+| headless | `PROFILE summary visual=all pose=gameplay03 runs=3 median_avg_ms=2.41 spread_ms=0.88 median_p95_ms=4.00`<br>`PROFILE summary visual=-haze pose=gameplay03 runs=3 median_avg_ms=2.34 spread_ms=0.48 median_p95_ms=4.00`<br>`PROFILE summary visual=none pose=gameplay03 runs=3 median_avg_ms=2.46 spread_ms=0.07 median_p95_ms=4.00`<br>`PROFILE summary visual=all pose=diorama02 runs=3 median_avg_ms=7.29 spread_ms=0.07 median_p95_ms=8.00`<br>`PROFILE summary visual=-haze pose=diorama02 runs=3 median_avg_ms=7.31 spread_ms=0.10 median_p95_ms=8.00`<br>`PROFILE summary visual=none pose=diorama02 runs=3 median_avg_ms=7.34 spread_ms=0.09 median_p95_ms=8.00` |
+| boot, `--cpu 1` | `BOOT map_build_ms median=452 runs=3 cpu=1`<br>`BOOT first_frame_ms median=3559 runs=3 cpu=1` (budgets 743 / 5321 ms: within) |
+
+Art (WebGL, whole frame; vis-ground has no Task 2 light, so compare with t01): diorama02 warmth 0.017 (t01) / 0.007
+(t06) -> 0.038, saturation 0.36 -> 0.41, contrast 0.171 -> 0.173, palette distance 0.85 -> 0.78; map land alone (column
+x 0.45-0.6) R-B 0.158 -> 0.229, saturation 0.254 -> 0.363, luma 0.576 -> 0.572. gameplay03 warmth 0.009 (t01) / 0.017
+-> 0.040, contrast 0.163 -> 0.173, palette distance 0.69 -> 0.66. The checkpoint also shoots the 6 km hero zoom over the
+Judean slopes and the Negev (`PromoPose.CloseChecks`, haze off): no AO steps.
+
## Checkpoints
| Task | Name | Images | Owner verdict |
|---|---|---|---|
| 1 | t01-before | captures/visual/t01-before/*-compare*.png | (owner) |
| 6 | t06-terrain | captures/visual/t06-terrain/*-compare*.png, editor/*-compare*.png | (owner) |
+| 6 (fix 1) | t06-terrain-r1 | captures/visual/t06-terrain-r1/*-compare*.png, hero06judea.png, hero06negev.png, editor/*-compare*.png | (owner) |
diff --git a/tools/README.md b/tools/README.md
index 806c57975..07a05b14f 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -16,7 +16,8 @@ Offline data tools (uv inline-script Python). Run from the repo root.
- `package_release.py` zips a Brotli WebGL build for sharing (`unity/Builds/statecraft-m3-web.zip`) and refuses
(exit 1) until every sensitive event is `sensitivity-reviewed` (docs/m3-release.md).
- `preview_map.py` renders the geography check image `tools/.cache/map-preview.png`.
-- `terrain_bake.py` writes `unity/Assets/Textures/Map/terrain_bake.png` (AO, curvature, sky-view) and `coast.png`
+- `terrain_bake.py` writes `unity/Assets/Textures/Map/terrain_bake.png` (AO, curvature, sky-view), `ao.png` (the AO
+ alone, imported uncompressed) and `coast.png`
(exact signed Euclidean distance to the shoreline; lakes under 1 km2 count as land) from the committed heightmap (no
network). Re-run it whenever the heightmap changes; its PNG bytes are reproducible only on the same toolchain.
- `terrain_graph.py` writes `unity/Assets/Shaders/StatecraftTerrain.shadergraph` from Unity's "Terrain Simple" template
@@ -39,7 +40,7 @@ Run from the repo root; this installs every pinned dependency (rasterio included
uv run --with pytest==9.1.1 --with rasterio==1.5.2 --with numpy==2.5.3 --with pyyaml==6.0.3 --with pillow==12.3.0 --with requests==2.32.5 pytest tools/tests -q
```
-Expected: `169 passed, 1 skipped` (the skipped one is the headed browser check; add `--headed` and `--with websockets==15.0.1` to run it). Omitting a dependency (e.g. rasterio) silently drops tests or fails collection.
+Expected: `172 passed, 1 skipped` (the skipped one is the headed browser check; add `--headed` and `--with websockets==15.0.1` to run it). Omitting a dependency (e.g. rasterio) silently drops tests or fails collection.
## Required attribution (Copernicus DEM licence, modified data)
diff --git a/tools/terrain_bake.py b/tools/terrain_bake.py
index a7b5aa327..760d5f599 100644
--- a/tools/terrain_bake.py
+++ b/tools/terrain_bake.py
@@ -8,6 +8,8 @@ Usage: uv run tools/terrain_bake.py (about 10 seconds)
Reads unity/Assets/StreamingAssets/map/heightmap.r16 + heightmap.json; writes, 2048 x 2048, row 0 = north:
unity/Assets/Textures/Map/terrain_bake.png RGB8: R ambient occlusion (horizon search to AO_RADIUS_M; 1 = open),
G curvature (0.5 flat, > 0.5 convex), B sky-view factor (horizon search to SKY_RADIUS_M)
+ unity/Assets/Textures/Map/ao.png L8: the same ambient occlusion as terrain_bake.png's R, on its own so Unity
+ imports it uncompressed (R8): block compression stepped it by 2+ levels on most broad slopes (Task 6 fix round 1)
unity/Assets/Textures/Map/coast.png L8: 0.5 + d / (2 COAST_RANGE_M), clamped; d = signed distance (m) to the
nearest shoreline, < 0 in water (open sea: |elevation| < SEA_EPS_M and connected to the map's border; lakes: flat
water below LAKE_BELOW_M covering at least MIN_LAKE_AREA_KM2), the rules tools/hexgrid.py uses for its sea and lake
@@ -243,7 +245,8 @@ def main(map_dir: Path = MAP_DIR, out_dir: Path = OUT_DIR) -> None:
out_dir.mkdir(parents=True, exist_ok=True)
Image.fromarray(rgb, "RGB").save(out_dir / "terrain_bake.png")
Image.fromarray(coast, "L").save(out_dir / "coast.png")
- print(f"wrote {out_dir / 'terrain_bake.png'} and {out_dir / 'coast.png'} ({coast.shape[1]} x {coast.shape[0]}): "
+ Image.fromarray(np.ascontiguousarray(rgb[..., 0]), "L").save(out_dir / "ao.png")
+ print(f"wrote {out_dir / 'terrain_bake.png'}, {out_dir / 'ao.png'} and {out_dir / 'coast.png'} ({coast.shape[1]} x {coast.shape[0]}): "
f"water {np.mean(coast < 128):.1%} of texels; AO mean {rgb[..., 0].mean() / 255:.3f}, sky-view mean {rgb[..., 2].mean() / 255:.3f}")
diff --git a/tools/terrain_graph.py b/tools/terrain_graph.py
index f02e6da97..3a116f49b 100644
--- a/tools/terrain_graph.py
+++ b/tools/terrain_graph.py
@@ -3,12 +3,12 @@
# dependencies = []
# ///
"""Writes unity/Assets/Shaders/StatecraftTerrain.shadergraph (shader "Statecraft/StatecraftTerrain"): Unity's own
-"Terrain Simple" Terrain Lit template with its sample nodes, groups and notes removed, and one Custom Function node
-(File mode, m_SourceType 0: StatecraftTerrain.hlsl, function StatecraftTerrain, single precision) that takes the terrain UV, the absolute
-world position and normal and two blackboard textures (_ScBakeTex, _ScCoastTex) and feeds every fragment block. All
-shading lives in the HLSL file; re-run this only when the node's inputs or outputs change. Slot objects are copied from
-the template's own slots, so they match the installed Shader Graph version. Object ids are UUID5s: the output is
-deterministic.
+"Terrain Simple" Terrain Lit template with its sample nodes, groups, notes and HDRP target removed, and one Custom
+Function node (File mode, m_SourceType 0: StatecraftTerrain.hlsl, function StatecraftTerrain; the graph and every added
+node at single precision) that takes the terrain UV, the absolute world position and normal and three blackboard
+textures (_ScBakeTex, _ScCoastTex, _ScAoTex) and feeds every fragment block. All shading lives in the HLSL file;
+re-run this only when the node's inputs or outputs change. Slot objects are copied from the template's own slots, so
+they match the installed Shader Graph version. Object ids are UUID5s: the output is deterministic.
Usage: uv run tools/terrain_graph.py
Needs unity/Library/PackageCache (open the project in Unity once) and unity/Assets/Shaders/StatecraftTerrain.hlsl.meta."""
@@ -26,14 +26,17 @@ GRAPH_PATH = "Statecraft"
FUNCTION = "StatecraftTerrain"
NS = uuid.UUID("5b0c1f7e-2f61-4c3a-9a57-7a1d1e0c6f42")
SG = "UnityEditor.ShaderGraph."
-SINGLE = 1 # Precision.Single
+SINGLE = 1 # Precision.Single (node precision)
+GRAPH_SINGLE = 0 # GraphPrecision.Single (the template's is Half, 2: an inheriting node would run at mediump on GLES3)
+URP = "UnityEditor.Rendering.Universal."
FILE_MODE = 0 # HlslSourceType.File (Shader Graph: enum HlslSourceType { File, String })
-TEXTURES = [("ScBakeTex", "_ScBakeTex", 3), ("ScCoastTex", "_ScCoastTex", 4)] # display name, reference, function slot
+# display name, reference, function slot; the AO is its own uncompressed texture (Task 6 fix round 1: BC1 banded it)
+TEXTURES = [("ScBakeTex", "_ScBakeTex", 3), ("ScCoastTex", "_ScCoastTex", 4), ("ScAoTex", "_ScAoTex", 5)]
INPUTS = [(0, "UV", "Vector2"), (1, "PositionWS", "Vector3"), (2, "NormalWS", "Vector3"),
- (3, "Bake", "Texture2DInput"), (4, "Coast", "Texture2DInput")]
-OUTPUTS = [(5, "BaseColor", "Vector3", "SurfaceDescription.BaseColor"), (6, "NormalOut", "Vector3", "SurfaceDescription.NormalWS"),
- (7, "Occlusion", "Vector1", "SurfaceDescription.Occlusion"), (8, "Smoothness", "Vector1", "SurfaceDescription.Smoothness"),
- (9, "Metallic", "Vector1", "SurfaceDescription.Metallic"), (10, "Emission", "Vector3", "SurfaceDescription.Emission")]
+ (3, "Bake", "Texture2DInput"), (4, "Coast", "Texture2DInput"), (5, "Ao", "Texture2DInput")]
+OUTPUTS = [(6, "BaseColor", "Vector3", "SurfaceDescription.BaseColor"), (7, "NormalOut", "Vector3", "SurfaceDescription.NormalWS"),
+ (8, "Occlusion", "Vector1", "SurfaceDescription.Occlusion"), (9, "Smoothness", "Vector1", "SurfaceDescription.Smoothness"),
+ (10, "Metallic", "Vector1", "SurfaceDescription.Metallic"), (11, "Emission", "Vector3", "SurfaceDescription.Emission")]
SLOT_KINDS = {"Vector1MaterialSlot", "Vector2MaterialSlot", "Vector3MaterialSlot", "Vector4MaterialSlot",
"Texture2DMaterialSlot", "Texture2DInputMaterialSlot"}
@@ -95,7 +98,8 @@ def build(template_text: str, hlsl_guid: str) -> str:
block_ids = [b["m_Id"] for ctx in ("m_VertexContext", "m_FragmentContext") for b in graph[ctx]["m_Blocks"]]
blocks = {by_id[i]["m_SerializedDescriptor"]: by_id[i] for i in block_ids}
- keep = [graph] + [o for o in objs[1:] if ".Rendering." in o["m_Type"] or kind(o) == "CategoryData"]
+ # Only the Universal target and its sub-target: the template's HDRP target is dead weight in this URP project.
+ keep = [graph] + [o for o in objs[1:] if o["m_Type"].startswith(URP) or kind(o) == "CategoryData"]
for i in block_ids:
keep.append(by_id[i])
keep += [by_id[s["m_Id"]] for s in by_id[i]["m_Slots"]]
@@ -105,7 +109,7 @@ def build(template_text: str, hlsl_guid: str) -> str:
o["m_ReceiveShadows"] = True
uv_out = make_slot(protos, "Vector4", 0, "Out", 1, "uv")
- uv = make_node("UVNode", "UV", [uv_out], {"m_OutputChannel": 0}, -900, 0)
+ uv = make_node("UVNode", "UV", [uv_out], {"m_OutputChannel": 0}, -900, 0, precision=SINGLE)
pos_out = make_slot(protos, "Vector3", 0, "Out", 1, "position")
pos = make_node("PositionNode", "Position", [pos_out], {"m_Space": 4, "m_PositionSource": 0}, -900, 150, version=1, precision=SINGLE)
nrm_out = make_slot(protos, "Vector3", 0, "Out", 1, "normal")
@@ -122,7 +126,8 @@ def build(template_text: str, hlsl_guid: str) -> str:
"m_Value": {"m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", "m_Guid": ""},
"isMainTexture": False, "useTilingAndOffset": False, "useTexelSize": False, "m_Modifiable": True, "m_DefaultType": 0}
out = make_slot(protos, "Texture2D", 0, "Out", 1, "prop:" + ref)
- pn = make_node("PropertyNode", display, [out], {"m_Property": {"m_Id": p["m_ObjectId"]}}, -900, 450 + 120 * len(props))
+ pn = make_node("PropertyNode", display, [out], {"m_Property": {"m_Id": p["m_ObjectId"]}}, -900, 450 + 120 * len(props),
+ precision=SINGLE)
props.append(p)
prop_nodes.append(pn)
added += [p, pn, out]
@@ -141,7 +146,8 @@ def build(template_text: str, hlsl_guid: str) -> str:
block = blocks[descriptor]
edges.append(edge(cf, sid, block, by_id[block["m_Slots"][0]["m_Id"]]["m_Id"]))
- graph.update(m_Path=GRAPH_PATH, m_Properties=[{"m_Id": p["m_ObjectId"]} for p in props], m_Keywords=[], m_Dropdowns=[],
+ graph.update(m_Path=GRAPH_PATH, m_GraphPrecision=GRAPH_SINGLE,
+ m_ActiveTargets=[{"m_Id": o["m_ObjectId"]} for o in keep if kind(o) == "UniversalTarget"], m_Properties=[{"m_Id": p["m_ObjectId"]} for p in props], m_Keywords=[], m_Dropdowns=[],
m_GroupDatas=[], m_StickyNoteDatas=[], m_Edges=edges,
m_Nodes=[{"m_Id": i} for i in block_ids] + [{"m_Id": n["m_ObjectId"]} for n in (uv, pos, nrm, *prop_nodes, cf)])
for o in keep:
diff --git a/tools/tests/test_terrain_bake.py b/tools/tests/test_terrain_bake.py
index 3c5488b6e..32d9bbc8d 100644
--- a/tools/tests/test_terrain_bake.py
+++ b/tools/tests/test_terrain_bake.py
@@ -155,7 +155,10 @@ def test_main_writes_both_textures_one_texel_smaller_and_deterministically(tmp_p
bake = png(tmp_path / "a" / "terrain_bake.png"); coast = png(tmp_path / "a" / "coast.png")
assert (bake.mode, bake.size) == ("RGB", (n - 1, n - 1))
assert (coast.mode, coast.size) == ("L", (n - 1, n - 1))
- for name in ("terrain_bake.png", "coast.png"):
+ ao = png(tmp_path / "a" / "ao.png")
+ assert (ao.mode, ao.size) == ("L", (n - 1, n - 1))
+ assert np.array_equal(np.asarray(ao), np.asarray(bake)[..., 0]), "ao.png is the bake's R channel, on its own"
+ for name in ("terrain_bake.png", "coast.png", "ao.png"):
assert (tmp_path / "a" / name).read_bytes() == (tmp_path / "b" / name).read_bytes()
c = np.asarray(coast)
assert c[:, :5].max() < 128 and c[:, 12:].min() > 128 # water west, land east
@@ -222,3 +225,10 @@ def test_the_committed_bake_shades_real_gorges_ridges_and_plateaus():
judean = box(b, 35.2, 35.4, 31.5, 31.8)[..., 0].mean()
coastal = box(b, 34.85, 34.95, 31.9, 32.3)[..., 0].mean()
assert judean < 0.8 and judean < coastal - 0.1, "the gullied Judean desert is darker than the coastal plain"
+
+
+def test_the_committed_ao_texture_is_the_bake_ao_uncompressed_on_its_own():
+ # Task 6 fix round 1: BC1 stepped the AO by 2+ levels on 59% of the broad Judean slopes; the shader samples this R8 copy.
+ ao = png(ROOT / "unity/Assets/Textures/Map/ao.png")
+ b = np.asarray(png(ROOT / "unity/Assets/Textures/Map/terrain_bake.png"))
+ assert ao.mode == "L" and np.array_equal(np.asarray(ao), b[..., 0])
diff --git a/tools/tests/test_terrain_graph.py b/tools/tests/test_terrain_graph.py
index ec9d7fd5c..3a9ef4c08 100644
--- a/tools/tests/test_terrain_graph.py
+++ b/tools/tests/test_terrain_graph.py
@@ -93,7 +93,7 @@ def test_the_textures_are_blackboard_properties_with_the_shaders_names():
objs, by_id = built()
graph = objs[0]
props = [by_id[p["m_Id"]] for p in graph["m_Properties"]]
- assert [p["m_DefaultReferenceName"] for p in props] == ["_ScBakeTex", "_ScCoastTex"]
+ assert [p["m_DefaultReferenceName"] for p in props] == ["_ScBakeTex", "_ScCoastTex", "_ScAoTex"]
cat = next(o for o in objs if tg.kind(o) == "CategoryData")
assert [c["m_Id"] for c in cat["m_ChildObjectList"]] == [p["m_ObjectId"] for p in props]
assert next(o for o in objs if tg.kind(o) == "UniversalTarget")["m_CastShadows"] is True
@@ -111,3 +111,31 @@ def test_every_edge_is_wired_to_existing_slots_and_the_output_is_deterministic()
assert e[end]["m_SlotId"] in [by_id[s["m_Id"]]["m_Id"] for s in node["m_Slots"]]
with pytest.raises(ValueError, match="slot prototypes"):
tg.build(fixture().replace("Texture2DInputMaterialSlot", "SomethingElse"), GUID)
+
+
+def test_every_added_node_and_the_graph_run_at_single_precision():
+ # Review I2: the template's graph precision is Half (2); a node that inherits it (the UV node has no inputs) would
+ # compute the terrain UV as mediump on GLES3 phones, steps of about 210 m north-south.
+ objs, _ = built()
+ assert objs[0]["m_GraphPrecision"] == tg.GRAPH_SINGLE == 0
+ for k in ("UVNode", "PositionNode", "NormalVectorNode", "PropertyNode", "CustomFunctionNode"):
+ assert all(o["m_Precision"] == 1 for o in objs if tg.kind(o) == k), k
+
+
+def test_only_the_universal_target_is_kept():
+ # Review M3: the template also carries an HDRP target and its data; this project is URP-only.
+ text = fixture_with_hdrp()
+ objs = tg.split(tg.build(text, GUID))
+ assert not [o for o in objs if "HighDefinition" in o["m_Type"]]
+ targets = [o["m_Id"] for o in objs[0]["m_ActiveTargets"]]
+ by_id = {o["m_ObjectId"]: o for o in objs}
+ assert [tg.kind(by_id[t]) for t in targets] == ["UniversalTarget"]
+
+
+def fixture_with_hdrp() -> str:
+ objs = tg.split(fixture())
+ hd_sub = obj("UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget", "hdsub")
+ hd = obj("UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget", "hd", m_ActiveSubTarget={"m_Id": "hdsub"})
+ objs[0]["m_ActiveTargets"].append({"m_Id": "hd"})
+ objs[0]["m_GraphPrecision"] = 2
+ return tg.join(objs + [hd, hd_sub])
diff --git a/unity/Assets/Editor/MapMaterials.cs b/unity/Assets/Editor/MapMaterials.cs
index f57502bfd..8e76e7dbb 100644
--- a/unity/Assets/Editor/MapMaterials.cs
+++ b/unity/Assets/Editor/MapMaterials.cs
@@ -24,6 +24,7 @@ namespace Statecraft.Game.EditorTools
var terrain = Make(TerrainPath, "Statecraft/StatecraftTerrain", null);
terrain.SetTexture("_ScBakeTex", Tex(Statecraft.Game.Map.MapTexturePaths.Bake));
terrain.SetTexture("_ScCoastTex", Tex(Statecraft.Game.Map.MapTexturePaths.Coast));
+ terrain.SetTexture("_ScAoTex", Tex(Statecraft.Game.Map.MapTexturePaths.Ao));
EditorUtility.SetDirty(terrain);
Make(OverlayPath, "Universal Render Pipeline/Unlit", new Color(0.15f, 0.12f, 0.08f, 1f));
// Settlement boxes: matte URP Lit; SettlementPlacer sets the per-type _BaseColor through a MaterialPropertyBlock.
diff --git a/unity/Assets/Editor/MapTextures.cs b/unity/Assets/Editor/MapTextures.cs
index 6433f5cc0..4a792573f 100644
--- a/unity/Assets/Editor/MapTextures.cs
+++ b/unity/Assets/Editor/MapTextures.cs
@@ -5,15 +5,17 @@ using UnityEngine;
namespace Statecraft.Game.EditorTools
{
- /// <summary>Import settings of the baked map textures: linear data (not sRGB), clamped, mipmapped, 2048. The shading bake
- /// is block-compressed (smooth fields compress well); the coast distance is one uncompressed 8-bit channel (R8), since
- /// compression blocks would show in the 350 m foam band. Idempotent; MapMaterials.Create calls it.</summary>
+ /// <summary>Import settings of the baked map textures: linear data (not sRGB), clamped, mipmapped, trilinear, 2048. The
+ /// shading bake (curvature, sky-view) is block-compressed; the coast distance and the AO are each one uncompressed 8-bit
+ /// channel (R8): compression blocks would show in the 350 m foam band, and BC1 stepped the AO on broad slopes (Task 6
+ /// fix round 1). Idempotent; MapMaterials.Create calls it.</summary>
public static class MapTextures
{
public static void Configure()
{
Set(MapTexturePaths.Bake, singleChannel: false);
Set(MapTexturePaths.Coast, singleChannel: true);
+ Set(MapTexturePaths.Ao, singleChannel: true);
}
static void Set(string path, bool singleChannel)
@@ -27,7 +29,8 @@ namespace Statecraft.Game.EditorTools
imp.SetTextureSettings(s);
}
imp.sRGBTexture = false; imp.mipmapEnabled = true; imp.isReadable = false;
- imp.wrapMode = TextureWrapMode.Clamp; imp.filterMode = FilterMode.Bilinear; imp.maxTextureSize = 2048;
+ imp.wrapMode = TextureWrapMode.Clamp; imp.filterMode = FilterMode.Trilinear; // no mip seams across the pitched view
+ imp.anisoLevel = path == MapTexturePaths.Bake ? 2 : 1; // the shading is seen at a grazing angle imp.maxTextureSize = 2048;
imp.textureCompression = singleChannel ? TextureImporterCompression.Uncompressed : TextureImporterCompression.Compressed;
imp.SaveAndReimport();
}
diff --git a/unity/Assets/Materials/Terrain.mat b/unity/Assets/Materials/Terrain.mat
index 5be2d908f..fdb58d5b6 100644
--- a/unity/Assets/Materials/Terrain.mat
+++ b/unity/Assets/Materials/Terrain.mat
@@ -75,6 +75,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
+ - _ScAoTex:
+ m_Texture: {fileID: 2800000, guid: cceebd5d9c12d466089402a2361e524f, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
- _ScBakeTex:
m_Texture: {fileID: 2800000, guid: 2170c5371eef64cf0ae3a9de5631722c, type: 3}
m_Scale: {x: 1, y: 1}
diff --git a/unity/Assets/Scripts/Map/MapBuilder.cs b/unity/Assets/Scripts/Map/MapBuilder.cs
index 5aa4d09fb..fbd752ea4 100644
--- a/unity/Assets/Scripts/Map/MapBuilder.cs
+++ b/unity/Assets/Scripts/Map/MapBuilder.cs
@@ -152,7 +152,7 @@ namespace Statecraft.Game.Map
var blender = new BiomeBlender(centres, layerOf, hexes.hex_size_km * 1000f, names.Count);
int res = BiomeTextureResolution;
var tex = assets.Own(new Texture2D(res, res, TextureFormat.RGBA32, true, false)
- { name = "BiomeColour", wrapMode = TextureWrapMode.Clamp, filterMode = FilterMode.Bilinear });
+ { name = "BiomeColour", wrapMode = TextureWrapMode.Clamp, filterMode = FilterMode.Trilinear });
var px = new Color32[res * res]; var wts = new float[names.Count];
for (int y = 0; y < res; y++)
for (int x = 0; x < res; x++)
@@ -163,7 +163,7 @@ namespace Statecraft.Game.Map
c.a = 1f;
px[y * res + x] = c;
}
- tex.SetPixels32(px); tex.Apply(true, false);
+ tex.SetPixels32(px); tex.Apply(true, true); // no CPU copy: nothing reads the pixels back (about 5.6 MB on the heap)
return tex;
}
diff --git a/unity/Assets/Scripts/Map/MapPalette.cs b/unity/Assets/Scripts/Map/MapPalette.cs
index 26f4fd9e8..c2d3a2c8f 100644
--- a/unity/Assets/Scripts/Map/MapPalette.cs
+++ b/unity/Assets/Scripts/Map/MapPalette.cs
@@ -10,12 +10,19 @@ namespace Statecraft.Game.Map
/// only seen where a lake or sea hex's blend reaches the shore; the water itself is shaded from the coast texture.</summary>
public static class MapPalette
{
+ /// <summary>Every ground colour is brightened by this factor in sRGB (about 1.25 in linear light) and clamped to
+ /// MaxChannel: the land keeps its luma once the haze no longer lifts it, warm instead of milky (Task 6 review I1).</summary>
+ public const float Brightness = 1.107f, MaxChannel = 0.95f;
+
public static IReadOnlyDictionary<string, Color> Ground { get; } = new Dictionary<string, Color>
{
- ["sea"] = new Color(0.62f, 0.60f, 0.42f), ["lake"] = new Color(0.60f, 0.58f, 0.42f),
- ["coastal_plain"] = new Color(0.64f, 0.62f, 0.36f), ["hills"] = new Color(0.66f, 0.58f, 0.38f),
- ["mountains"] = new Color(0.62f, 0.53f, 0.40f), ["valley"] = new Color(0.58f, 0.58f, 0.37f),
- ["desert"] = new Color(0.84f, 0.70f, 0.48f),
+ ["sea"] = Lit(0.62f, 0.60f, 0.42f), ["lake"] = Lit(0.60f, 0.58f, 0.42f),
+ ["coastal_plain"] = Lit(0.64f, 0.62f, 0.36f), ["hills"] = Lit(0.66f, 0.58f, 0.38f),
+ ["mountains"] = Lit(0.62f, 0.53f, 0.40f), ["valley"] = Lit(0.58f, 0.58f, 0.37f),
+ ["desert"] = Lit(0.84f, 0.70f, 0.48f),
};
+
+ static Color Lit(float r, float g, float b) =>
+ new Color(Mathf.Min(r * Brightness, MaxChannel), Mathf.Min(g * Brightness, MaxChannel), Mathf.Min(b * Brightness, MaxChannel));
}
}
diff --git a/unity/Assets/Scripts/Map/MapShaderGlobals.cs b/unity/Assets/Scripts/Map/MapShaderGlobals.cs
index 3644e7ffb..97c4760bd 100644
--- a/unity/Assets/Scripts/Map/MapShaderGlobals.cs
+++ b/unity/Assets/Scripts/Map/MapShaderGlobals.cs
@@ -12,19 +12,20 @@ namespace Statecraft.Game.Map
Biome = Shader.PropertyToID("_ScBiomeTex"), Haze = Shader.PropertyToID("_ScHaze"), HazeWater = Shader.PropertyToID("_ScHazeWater"),
HazeRange = Shader.PropertyToID("_ScHazeRange");
- /// <summary>A warm, dusty haze over land (sRGB).</summary>
- public static readonly Color HazeColour = new Color(0.80f, 0.76f, 0.68f);
- public const float HazeMax = 0.6f;
+ /// <summary>A warm, dusty haze over land (sRGB): warmer than the ground it covers (R - B 0.26), so the far land reads
+ /// as dust, not as a cool milky veil (Task 6 review I1).</summary>
+ public static readonly Color HazeColour = new Color(0.84f, 0.74f, 0.58f);
+ public const float HazeMax = 0.45f;
/// <summary>A cooler, weaker haze over water (review I2), so the sea stays the promo's saturated blue towards the
/// horizon: 0.4 of the land's strength.</summary>
public static readonly Color WaterHazeColour = new Color(0.62f, 0.74f, 0.86f);
public const float WaterHazeMax = HazeMax * 0.4f;
- /// <summary>Distance scale of the aerial haze: 1 - exp(-d / scale); at the gameplay pose's far edge (about 85 km) 19%.</summary>
- public const float HazeDistanceM = 400000f;
+ /// <summary>The aerial haze is 1 - exp(-max(d - start, 0) / scale), times HazeMax: none within 200 km (the gameplay
+ /// pose, 48-91 km, has none: its depth cue is the tilt-shift), about 2% at the country-wide pose's nearest land
+ /// (about 205 km) and 17% at its horizon (about 400 km): a depth cue, not a veil (review I1).</summary>
+ public const float HazeStartM = 200000f, HazeDistanceM = 250000f;
/// <summary>Real elevations between which the haze thickens, low in the Jordan rift.</summary>
- // Whole metres, written as integer literals: HudTests.NoScriptRescalesADisplayedNumberItself would read the float
- // literal of a hundred as a percent rescale.
- public const float RiftHazeTopM = -100, RiftHazeFullM = -400;
+ public const float RiftHazeTopM = -100f, RiftHazeFullM = -400f;
static Vector4 haze, hazeWater;
@@ -41,7 +42,7 @@ namespace Statecraft.Game.Map
hazeWater = new Vector4(w.r, w.g, w.b, WaterHazeMax);
Shader.SetGlobalVector(Haze, haze);
Shader.SetGlobalVector(HazeWater, hazeWater);
- Shader.SetGlobalVector(HazeRange, new Vector4(Y(RiftHazeTopM), Y(RiftHazeFullM), HazeDistanceM, 0f));
+ Shader.SetGlobalVector(HazeRange, new Vector4(Y(RiftHazeTopM), Y(RiftHazeFullM), HazeDistanceM, HazeStartM));
assets.OnTeardown(VisualToggles.Register("haze", on =>
{
Shader.SetGlobalVector(Haze, on ? haze : new Vector4(haze.x, haze.y, haze.z, 0f));
@@ -55,5 +56,7 @@ namespace Statecraft.Game.Map
{
public const string Bake = "Assets/Textures/Map/terrain_bake.png";
public const string Coast = "Assets/Textures/Map/coast.png";
+ /// <summary>The ambient occlusion on its own, uncompressed (R8): BC1 stepped it on broad slopes (Task 6 fix round 1).</summary>
+ public const string Ao = "Assets/Textures/Map/ao.png";
}
}
diff --git a/unity/Assets/Scripts/Map/PromoPose.cs b/unity/Assets/Scripts/Map/PromoPose.cs
index cf25df21a..48bd0fd30 100644
--- a/unity/Assets/Scripts/Map/PromoPose.cs
+++ b/unity/Assets/Scripts/Map/PromoPose.cs
@@ -25,6 +25,14 @@ namespace Statecraft.Game.Map
public static IReadOnlyList<PromoPose> All { get; } = new[] { Gameplay03, Diorama02 };
+ /// <summary>Close checks for the art checkpoint, not promo matches (Task 6 review A3): the 6 km hero zoom over the
+ /// Judean slopes and over the Negev plateau, where texture steps in the baked shading would show. VisualShots shoots
+ /// them after All, with the haze off.</summary>
+ public static IReadOnlyList<PromoPose> CloseChecks { get; } = new[]
+ {
+ new PromoPose("hero06judea", 35.15, 31.78, 6000f, 0f), new PromoPose("hero06negev", 34.90, 30.60, 6000f, 0f),
+ };
+
public void Apply(CameraRig rig, GeoFrame frame)
{
rig.LookAt = frame.ToWorld(Lon, Lat, 0); rig.Distance = Distance; rig.Yaw = Yaw; rig.Apply();
diff --git a/unity/Assets/Scripts/Map/VisualShots.cs b/unity/Assets/Scripts/Map/VisualShots.cs
index 42e44f766..564f7dad6 100644
--- a/unity/Assets/Scripts/Map/VisualShots.cs
+++ b/unity/Assets/Scripts/Map/VisualShots.cs
@@ -37,16 +37,23 @@ namespace Statecraft.Game.Map
public static IEnumerator Run(CameraRig rig, GeoFrame frame, Action<string> log)
{
- foreach (var pose in PromoPose.All)
- {
- pose.Apply(rig, frame);
- for (int i = 0; i < SettleFrames; i++) yield return null;
- yield return new WaitForEndOfFrame();
- var tex = ScreenCapture.CaptureScreenshotAsTexture();
- try { foreach (var line in Lines(pose.Name, tex.EncodeToPNG())) log(line); }
- finally { UnityEngine.Object.Destroy(tex); }
- }
+ foreach (var pose in PromoPose.All) yield return Shoot(rig, frame, pose, log);
+ // The close checks look at the ground itself, so the haze (if registered) is off for them and restored after.
+ bool haze = VisualToggles.Names.Contains("haze");
+ if (haze) VisualToggles.Set("haze", false);
+ try { foreach (var pose in PromoPose.CloseChecks) yield return Shoot(rig, frame, pose, log); }
+ finally { if (haze && VisualToggles.Names.Contains("haze")) VisualToggles.Set("haze", true); }
log("SHOT done");
}
+
+ static IEnumerator Shoot(CameraRig rig, GeoFrame frame, PromoPose pose, Action<string> log)
+ {
+ pose.Apply(rig, frame);
+ for (int i = 0; i < SettleFrames; i++) yield return null;
+ yield return new WaitForEndOfFrame();
+ var tex = ScreenCapture.CaptureScreenshotAsTexture();
+ try { foreach (var line in Lines(pose.Name, tex.EncodeToPNG())) log(line); }
+ finally { UnityEngine.Object.Destroy(tex); }
+ }
}
}
diff --git a/unity/Assets/Shaders/StatecraftMap.hlsl b/unity/Assets/Shaders/StatecraftMap.hlsl
index bf540d480..4602e5768 100644
--- a/unity/Assets/Shaders/StatecraftMap.hlsl
+++ b/unity/Assets/Shaders/StatecraftMap.hlsl
@@ -7,7 +7,7 @@ float4 _ScMap; // x width (m, east), y length (m, north), z sea level (wo
float4 _ScMapOrigin; // xyz terrain origin (world), w hex circumradius (m)
float4 _ScHaze; // rgb land haze colour (linear), a strongest land haze (0..1)
float4 _ScHazeWater; // rgb water haze colour (linear, cooler), a strongest water haze (weaker: the sea keeps its blue)
-float4 _ScHazeRange; // x rift haze begins (world y), y rift haze is full (world y), z aerial distance scale (m)
+float4 _ScHazeRange; // x rift haze begins (world y), y rift haze is full (world y), z aerial distance scale (m), w start (m)
TEXTURE2D(_ScBiomeTex); SAMPLER(sampler_ScBiomeTex);
float ScHash(float2 p)
@@ -24,15 +24,18 @@ float ScNoise(float2 p)
return lerp(lerp(ScHash(i), ScHash(i + float2(1, 0)), u.x), lerp(ScHash(i + float2(0, 1)), ScHash(i + float2(1, 1)), u.x), u.y);
}
-// Aerial perspective, 0..1 before each surface's strength: grows with distance (1 - exp(-d / scale)) and up to 2.5x low in
-// the rift. It is applied after lighting on both surfaces (review I2): land outputs BaseColor x (1 - h) plus Emission =
+// Low in the rift the haze grows by up to this share (1.5 saturated the rift at the country-wide zoom: Task 6 review I1).
+static const float ScRiftHazeBoost = 0.6;
+
+// Aerial perspective, 0..1 before each surface's strength: none within the start distance, then 1 - exp(-(d - start) /
+// scale), and up to 1.6x low in the rift. It is applied after lighting on both surfaces (review I2): land outputs BaseColor x (1 - h) plus Emission =
// haze colour x h, so Lit's result is lerp(lit ground, haze, h); water lerps its final colour (ScHazeWater).
float ScHazeAmount(float3 positionWS)
{
float dist = length(_WorldSpaceCameraPos - positionWS);
- float aerial = 1.0 - exp(-dist / max(_ScHazeRange.z, 1.0));
+ float aerial = 1.0 - exp(-max(dist - _ScHazeRange.w, 0.0) / max(_ScHazeRange.z, 1.0));
float low = saturate((_ScHazeRange.x - positionWS.y) / max(_ScHazeRange.x - _ScHazeRange.y, 1.0));
- return saturate(aerial * (1.0 + 1.5 * low));
+ return saturate(aerial * (1.0 + ScRiftHazeBoost * low));
}
float3 ScHazeWater(float3 colour, float3 positionWS)
@@ -44,7 +47,7 @@ float3 ScHazeWater(float3 colour, float3 positionWS)
float ScWater(float coast) { return 1.0 - smoothstep(0.497, 0.503, coast); }
// The painted ground: biome colour, warmer stone high up, a dusty rift floor, rock on steep slopes, two octaves of
-// breakup, curvature (ridges light, hollows dark) and the baked occlusion (bake: r AO, g curvature, b sky-view).
+// breakup, curvature (ridges light, hollows dark) and the baked occlusion (bake: r AO from ao.png, g curvature, b sky-view).
float3 ScGround(float2 uv, float2 mapM, float3 n, float3 positionWS, float4 bake)
{
float elevM = (positionWS.y - _ScMap.z) / _ScMap.w; // real metres above sea level
@@ -54,8 +57,10 @@ float3 ScGround(float2 uv, float2 mapM, float3 n, float3 positionWS, float4 bake
g = lerp(g, g * float3(1.10, 1.04, 0.92), 1.0 - smoothstep(-350.0, -150.0, elevM));
float rock = smoothstep(0.22, 0.45, slope + (ScNoise(mapM / 900.0) - 0.5) * 0.12);
g = lerp(g, SRGBToLinear(float3(0.56, 0.49, 0.41)), rock);
- g *= 0.93 + 0.14 * (ScNoise(mapM / 2600.0) * 0.6 + ScNoise(mapM / 520.0) * 0.4);
- g *= 1.0 + 0.30 * (bake.g - 0.5) * 2.0;
+ // The fine octave fades to its mean as a pixel's footprint nears its 520 m period, so it never aliases into shimmer.
+ float fine = lerp(0.5, ScNoise(mapM / 520.0), 1.0 - saturate(length(fwidth(mapM)) / 520.0));
+ g *= 0.93 + 0.14 * (ScNoise(mapM / 2600.0) * 0.6 + fine * 0.4);
+ g *= 1.0 + 0.40 * (bake.g - 0.5) * 2.0;
g *= lerp(1.0, bake.r * lerp(0.6, 1.0, bake.b), 0.45);
return g;
}
diff --git a/unity/Assets/Shaders/StatecraftTerrain.hlsl b/unity/Assets/Shaders/StatecraftTerrain.hlsl
index 98c03102c..70b8a326e 100644
--- a/unity/Assets/Shaders/StatecraftTerrain.hlsl
+++ b/unity/Assets/Shaders/StatecraftTerrain.hlsl
@@ -4,12 +4,14 @@
// The Custom Function of StatecraftTerrain.shadergraph (written by tools/terrain_graph.py; keep this signature in step with
// its INPUTS and OUTPUTS). UV is the terrain UV (0..1 over the map); PositionWS and NormalWS are absolute world space;
-// Bake is terrain_bake.png (r AO, g curvature, b sky-view); Coast is coast.png (0.5 = shore, lower = water).
-void StatecraftTerrain_float(float2 UV, float3 PositionWS, float3 NormalWS, UnityTexture2D Bake, UnityTexture2D Coast,
+// Bake is terrain_bake.png (g curvature, b sky-view; its r is not read); Coast is coast.png (0.5 = shore, lower = water);
+// Ao is ao.png, the ambient occlusion on its own, uncompressed (BC1 banded it: Task 6 fix round 1).
+void StatecraftTerrain_float(float2 UV, float3 PositionWS, float3 NormalWS, UnityTexture2D Bake, UnityTexture2D Coast, UnityTexture2D Ao,
out float3 BaseColor, out float3 NormalOut, out float Occlusion, out float Smoothness, out float Metallic, out float3 Emission)
{
float3 n = normalize(NormalWS);
float4 bake = SAMPLE_TEXTURE2D(Bake.tex, Bake.samplerstate, UV);
+ bake.r = SAMPLE_TEXTURE2D(Ao.tex, Ao.samplerstate, UV).r;
float coast = SAMPLE_TEXTURE2D(Coast.tex, Coast.samplerstate, UV).r;
float2 mapM = UV * _ScMap.xy;
float3 ground = ScGround(UV, mapM, n, PositionWS, bake);
diff --git a/unity/Assets/Shaders/StatecraftTerrain.shadergraph b/unity/Assets/Shaders/StatecraftTerrain.shadergraph
index 29f67c9d8..7a4623484 100644
--- a/unity/Assets/Shaders/StatecraftTerrain.shadergraph
+++ b/unity/Assets/Shaders/StatecraftTerrain.shadergraph
@@ -8,6 +8,9 @@
},
{
"m_Id": "6c3b295f2d98598598e0245ee0a38e65"
+ },
+ {
+ "m_Id": "b88f877cf9865c24bc626b97cf41ff89"
}
],
"m_Keywords": [],
@@ -54,6 +57,9 @@
{
"m_Id": "a3e15ab001b759f6b126319858f4b91e"
},
+ {
+ "m_Id": "459d970584a0580e866734ec5e367cae"
+ },
{
"m_Id": "0c721d24051f5765970882f281b1f92f"
}
@@ -133,10 +139,24 @@
},
{
"m_OutputSlot": {
+ "m_Node": {
+ "m_Id": "459d970584a0580e866734ec5e367cae"
+ },
+ "m_SlotId": 0
+ },
+ "m_InputSlot": {
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
"m_SlotId": 5
+ }
+ },
+ {
+ "m_OutputSlot": {
+ "m_Node": {
+ "m_Id": "0c721d24051f5765970882f281b1f92f"
+ },
+ "m_SlotId": 6
},
"m_InputSlot": {
"m_Node": {
@@ -150,7 +170,7 @@
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
- "m_SlotId": 6
+ "m_SlotId": 7
},
"m_InputSlot": {
"m_Node": {
@@ -164,7 +184,7 @@
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
- "m_SlotId": 7
+ "m_SlotId": 8
},
"m_InputSlot": {
"m_Node": {
@@ -178,7 +198,7 @@
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
- "m_SlotId": 8
+ "m_SlotId": 9
},
"m_InputSlot": {
"m_Node": {
@@ -192,7 +212,7 @@
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
- "m_SlotId": 9
+ "m_SlotId": 10
},
"m_InputSlot": {
"m_Node": {
@@ -206,7 +226,7 @@
"m_Node": {
"m_Id": "0c721d24051f5765970882f281b1f92f"
},
- "m_SlotId": 10
+ "m_SlotId": 11
},
"m_InputSlot": {
"m_Node": {
@@ -261,209 +281,19 @@
"preventRotation": false
},
"m_Path": "Statecraft",
- "m_GraphPrecision": 2,
+ "m_GraphPrecision": 0,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
- {
- "m_Id": "fae0956ffbe844049ecc902ae2d3a790"
- },
{
"m_Id": "36f0c9c016e64fe09de33416739d5bde"
}
]
}
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "01362e5f3582451daae9e107d6ab8251",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "04b39b25d8cf4a209bfaacef8f49806c",
- "m_NormalDropOffSpace": 2,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 0,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "068ba20301984c44b9e5e1028b0be9ec",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "0b5f3cd0d4284616a338d139bbc192fe"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "0eb7f72acf3f49a6902e08bb6b942511",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "14de12e84a754ddc85b4044a5f06a6f6",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "153f998865404f90b7545c132060f0cb",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "262a16b1f12f425f9438e6a956593999",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "281a8f77e71a488cb2a1dba2d375d754",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "2b09475c5ab449eb988b2b3d528000c4",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "3281eb9c8f24472abe6c9a0f4171920d"
-}
-
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTerrainLitSubTarget",
@@ -501,168 +331,6 @@
"m_SupportVFX": false
}
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "376c08cf30604cca875694fe7edbc7ec",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "39e38063d9c245d38cb1b53142c0a90c"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "39f89452995e4b3f83f51fb317a21332",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "444c7c70b4a94a098abe529ac9d59655",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "4a3fa0f005304f75a4b3cd7ae452c751",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "5651a258420f4a8082e597f2286efe9f",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "59cd7c40c3ca463691f1ee29f93dfa93",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "62766492890547c3bf6ba57262dd0b1e",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
@@ -674,524 +342,11 @@
},
{
"m_Id": "6c3b295f2d98598598e0245ee0a38e65"
- }
- ]
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "7613bde247b745d08a129a9681acaf49",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "7830a014364540369f4e725f1eb9f5ed",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "7cb10bd1ba1f4efe99caca400f8d27dd",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "7da39c63cf9e4a41892cb6baaf70c020",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "8010fb853be345ddb0fffc78e49deb2a"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "8c065b7dad1d4985844821e5ba4b03e5",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "9267ca2c7c734d49b96521a9d02d940a",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 9
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "964f8b6a72d64d848e72f72e89bfa580",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "a2f8234609584f19bc8d92c913fc6735"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "a3b2bdb1447943c284e8690a37d94da8",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "a655831097ad413d890304239acc6084",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "a948a7d33e1b49b380b1bc6f82c15f35",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "a9e5f341d62644a9b8822d1e80bec354",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "ae3851f4471e48ce986c42c608ad6083",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "af9c871ef30c4751adee4315ea348701",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "b2e9508056f641ab858939665713138e",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "b7170e0507ab4c6eaaba42164634a575",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "b758094cb6d340d8bca9fdc1a52e3295"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "c3a3b4429181426dbba913e05f25e287",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "c3ea601afbcf44179bc869232b6f8b9b",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "ccee7f5c3e1e44e99f64aa526d66d35b"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "d2e44104eebc4432aab804025bbcc4e3",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "e47f712290094d04a76c4371977e08c7",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "ebea0ef64d95450f8b04fc9256d022a1"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData",
- "m_ObjectId": "ecd9dbaa6d2a4675ae1300b3416a1043",
- "m_NormalDropOffSpace": 0,
- "m_BlendPreserveSpecular": true,
- "m_ReceiveDecals": true,
- "m_ReceiveSSR": true,
- "m_ReceiveSSRTransparent": false,
- "m_SpecularAA": false,
- "m_SpecularOcclusionMode": 1,
- "m_OverrideBakedGI": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "eee3afb7f90c4726a7849dd710fe7dfa",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData",
- "m_ObjectId": "f432006b28c44b6ead72243ae2e8e41f",
- "m_MaterialNeedsUpdateHash": 0,
- "m_SurfaceType": 0,
- "m_RenderingPass": 1,
- "m_BlendMode": 0,
- "m_ZTest": 4,
- "m_ZWrite": false,
- "m_TransparentCullMode": 2,
- "m_OpaqueCullMode": 2,
- "m_SortPriority": 0,
- "m_AlphaTest": false,
- "m_ExcludeFromTUAndAA": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_SupportLodCrossFade": false,
- "m_DoubleSidedMode": 0,
- "m_DOTSInstancing": false,
- "m_CustomVelocity": false,
- "m_Tessellation": false,
- "m_TessellationMode": 0,
- "m_TessellationFactorMinDistance": 20.0,
- "m_TessellationFactorMaxDistance": 50.0,
- "m_TessellationFactorTriangleSize": 100.0,
- "m_TessellationShapeFactor": 0.75,
- "m_TessellationBackFaceCullEpsilon": -0.25,
- "m_TessellationMaxDisplacement": 0.009999999776482582,
- "m_DebugSymbols": false,
- "m_Version": 2,
- "inspectorFoldoutMask": 0
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "f78263900b9a449fb0048b6e6eaae6da"
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData",
- "m_ObjectId": "f85b8bfcea3c439481ba7aab5cff3d00",
- "m_Distortion": false,
- "m_DistortionMode": 0,
- "m_DistortionDepthTest": true,
- "m_AddPrecomputedVelocity": false,
- "m_TransparentWritesMotionVec": false,
- "m_DepthOffset": false,
- "m_ConservativeDepthOffset": false,
- "m_TransparencyFog": true,
- "m_AlphaTestShadow": false,
- "m_BackThenFrontRendering": false,
- "m_TransparentDepthPrepass": false,
- "m_TransparentDepthPostpass": false,
- "m_TransparentPerPixelSorting": false,
- "m_SupportLodCrossFade": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitData",
- "m_ObjectId": "f8c5588f5c2b4aa3b5b7c2464952737f",
- "m_EnableHeightBlened": false,
- "m_HeightTransition": 0.0,
- "m_EnableInstancedPerPixelNormal": true,
- "m_RayTracing": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget",
- "m_ObjectId": "fae0956ffbe844049ecc902ae2d3a790",
- "m_ActiveSubTarget": {
- "m_Id": "b758094cb6d340d8bca9fdc1a52e3295"
- },
- "m_Datas": [
- {
- "m_Id": "04b39b25d8cf4a209bfaacef8f49806c"
- },
- {
- "m_Id": "c3a3b4429181426dbba913e05f25e287"
},
{
- "m_Id": "9267ca2c7c734d49b96521a9d02d940a"
- },
- {
- "m_Id": "153f998865404f90b7545c132060f0cb"
+ "m_Id": "b88f877cf9865c24bc626b97cf41ff89"
}
- ],
- "m_CustomEditorGUI": "",
- "m_SupportVFX": false,
- "m_SupportLineRendering": false
-}
-
-{
- "m_SGVersion": 0,
- "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.TerrainLitSubTarget",
- "m_ObjectId": "fc0756cde95049dd8b0c7608337c3c9f"
+ ]
}
{
@@ -1612,7 +767,7 @@
}
],
"synonyms": [],
- "m_Precision": 0,
+ "m_Precision": 1,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
@@ -1819,7 +974,7 @@
}
],
"synonyms": [],
- "m_Precision": 0,
+ "m_Precision": 1,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
@@ -1901,7 +1056,7 @@
}
],
"synonyms": [],
- "m_Precision": 0,
+ "m_Precision": 1,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
@@ -1926,6 +1081,88 @@
"m_BareResource": false
}
+{
+ "m_SGVersion": 0,
+ "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
+ "m_ObjectId": "b88f877cf9865c24bc626b97cf41ff89",
+ "m_Guid": {
+ "m_GuidSerialized": "a2e90795-8605-500f-94e5-7bbe2cd660fc"
+ },
+ "m_Name": "ScAoTex",
+ "m_DefaultRefNameVersion": 1,
+ "m_RefNameGeneratedByDisplayName": "ScAoTex",
+ "m_DefaultReferenceName": "_ScAoTex",
+ "m_OverrideReferenceName": "",
+ "m_GeneratePropertyBlock": true,
+ "m_UseCustomSlotLabel": false,
+ "m_CustomSlotLabel": "",
+ "m_DismissedVersion": 0,
+ "m_Precision": 0,
+ "overrideHLSLDeclaration": false,
+ "hlslDeclarationOverride": 0,
+ "m_Hidden": false,
+ "m_PerRendererData": false,
+ "m_customAttributes": [],
+ "m_Value": {
+ "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
+ "m_Guid": ""
+ },
+ "isMainTexture": false,
+ "useTilingAndOffset": false,
+ "useTexelSize": false,
+ "m_Modifiable": true,
+ "m_DefaultType": 0
+}
+
+{
+ "m_SGVersion": 0,
+ "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
+ "m_ObjectId": "459d970584a0580e866734ec5e367cae",
+ "m_Group": {
+ "m_Id": ""
+ },
+ "m_Name": "ScAoTex",
+ "m_DrawState": {
+ "m_Expanded": true,
+ "m_Position": {
+ "serializedVersion": "2",
+ "x": -900,
+ "y": 690,
+ "width": 220.0,
+ "height": 130.0
+ }
+ },
+ "m_Slots": [
+ {
+ "m_Id": "e2b519e725035dfa950b1bb5185115c4"
+ }
+ ],
+ "synonyms": [],
+ "m_Precision": 1,
+ "m_PreviewExpanded": false,
+ "m_DismissedVersion": 0,
+ "m_PreviewMode": 0,
+ "m_CustomColors": {
+ "m_SerializableColors": []
+ },
+ "m_Property": {
+ "m_Id": "b88f877cf9865c24bc626b97cf41ff89"
+ }
+}
+
+{
+ "m_SGVersion": 0,
+ "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
+ "m_ObjectId": "e2b519e725035dfa950b1bb5185115c4",
+ "m_Id": 0,
+ "m_DisplayName": "Out",
+ "m_SlotType": 1,
+ "m_Hidden": false,
+ "m_ShaderOutputName": "Out",
+ "m_StageCapability": 3,
+ "m_BareResource": false
+}
+
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
@@ -1977,6 +1214,9 @@
},
{
"m_Id": "e25c4c763f6f5b329ac0aeaf3c6da58f"
+ },
+ {
+ "m_Id": "abf5fa1d15a056659dc662004373702b"
}
],
"synonyms": [],
@@ -2099,9 +1339,27 @@
{
"m_SGVersion": 0,
- "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
+ "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
"m_ObjectId": "8990932a9fe95bfabd3d5e645cf3bc58",
"m_Id": 5,
+ "m_DisplayName": "Ao",
+ "m_SlotType": 0,
+ "m_Hidden": false,
+ "m_ShaderOutputName": "Ao",
+ "m_StageCapability": 3,
+ "m_BareResource": false,
+ "m_Texture": {
+ "m_SerializedTexture": "",
+ "m_Guid": ""
+ },
+ "m_DefaultType": 0
+}
+
+{
+ "m_SGVersion": 0,
+ "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
+ "m_ObjectId": "87a7dd817fad59ecb1f11eb968ed2567",
+ "m_Id": 6,
"m_DisplayName": "BaseColor",
"m_SlotType": 1,
"m_Hidden": false,
@@ -2123,8 +1381,8 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
- "m_ObjectId": "87a7dd817fad59ecb1f11eb968ed2567",
- "m_Id": 6,
+ "m_ObjectId": "11344551a71f5c03a8b7bbd1c15b0c1a",
+ "m_Id": 7,
"m_DisplayName": "NormalOut",
"m_SlotType": 1,
"m_Hidden": false,
@@ -2146,8 +1404,8 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
- "m_ObjectId": "11344551a71f5c03a8b7bbd1c15b0c1a",
- "m_Id": 7,
+ "m_ObjectId": "cb63b71e6a3f5e86be2b475b2f4c76d8",
+ "m_Id": 8,
"m_DisplayName": "Occlusion",
"m_SlotType": 1,
"m_Hidden": false,
@@ -2162,8 +1420,8 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
- "m_ObjectId": "cb63b71e6a3f5e86be2b475b2f4c76d8",
- "m_Id": 8,
+ "m_ObjectId": "2760420ab9605db9a7b6dbeeb57b12b1",
+ "m_Id": 9,
"m_DisplayName": "Smoothness",
"m_SlotType": 1,
"m_Hidden": false,
@@ -2178,8 +1436,8 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
- "m_ObjectId": "2760420ab9605db9a7b6dbeeb57b12b1",
- "m_Id": 9,
+ "m_ObjectId": "e25c4c763f6f5b329ac0aeaf3c6da58f",
+ "m_Id": 10,
"m_DisplayName": "Metallic",
"m_SlotType": 1,
"m_Hidden": false,
@@ -2194,8 +1452,8 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
- "m_ObjectId": "e25c4c763f6f5b329ac0aeaf3c6da58f",
- "m_Id": 10,
+ "m_ObjectId": "abf5fa1d15a056659dc662004373702b",
+ "m_Id": 11,
"m_DisplayName": "Emission",
"m_SlotType": 1,
"m_Hidden": false,
diff --git a/unity/Assets/Tests/EditMode/HudTests.cs b/unity/Assets/Tests/EditMode/HudTests.cs
index f22e74c76..4bb1e97f5 100644
--- a/unity/Assets/Tests/EditMode/HudTests.cs
+++ b/unity/Assets/Tests/EditMode/HudTests.cs
@@ -368,6 +368,7 @@ public class HudTests
{
("MinimapPresenter.cs", "Length.Percent(", "the view frame's position and size in percent of the picture (layout, not text)"),
("PortraitFraming.cs", "offset / (h - boxH) * 100f", "a portrait's background-position-y in percent (layout, not text)"),
+ ("MapShaderGlobals.cs", "RiftHazeTopM = -100f", "a real elevation in metres for the rift haze (shader input, not a displayed number)"),
};
[Test]
diff --git a/unity/Assets/Tests/EditMode/TerrainShaderTests.cs b/unity/Assets/Tests/EditMode/TerrainShaderTests.cs
index 77c934cd1..c2c6e76be 100644
--- a/unity/Assets/Tests/EditMode/TerrainShaderTests.cs
+++ b/unity/Assets/Tests/EditMode/TerrainShaderTests.cs
@@ -2,6 +2,7 @@
using System.Collections;
using System.Linq;
using NUnit.Framework;
+using Statecraft.Game;
using Statecraft.Game.Map;
using UnityEditor;
using UnityEditor.SceneManagement;
@@ -38,6 +39,14 @@ public class TerrainShaderTests
for (int p = 0; p < sub.PassCount; p++) if (sub.GetPass(p).SourceCode.Contains("StatecraftTerrain.hlsl")) including++;
}
Assert.Greater(including, 0, "no generated pass includes StatecraftTerrain.hlsl: the Custom Function is not in File mode");
+ // Review I2: no node may compute at the template's half precision (mediump on GLES3 phones: ~210 m UV steps).
+ for (int s = 0; s < data.SubshaderCount; s++)
+ {
+ var sub = data.GetSerializedSubshader(s);
+ for (int p = 0; p < sub.PassCount; p++)
+ Assert.IsFalse(System.Text.RegularExpressions.Regex.IsMatch(sub.GetPass(p).SourceCode, @"\bhalf[234]? _UV_"),
+ $"pass '{sub.GetPass(p).Name}' computes the terrain UV at half precision");
+ }
var map = OpenMap();
yield return null;
var cam = Camera.main; var rig = cam.GetComponent<CameraRig>();
@@ -67,6 +76,7 @@ public class TerrainShaderTests
Assert.IsFalse(ShaderUtil.ShaderHasError(mat.shader), string.Join("\n", ShaderUtil.GetShaderMessages(mat.shader).Select(m => m.message)));
Assert.AreEqual(AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Bake), mat.GetTexture("_ScBakeTex"));
Assert.AreEqual(AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Coast), mat.GetTexture("_ScCoastTex"));
+ Assert.AreEqual(AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Ao), mat.GetTexture("_ScAoTex"));
CollectionAssert.AreEquivalent(MapBuilder.BiomeColours.Keys, MapPalette.Ground.Keys, "a ground colour for every biome");
}
@@ -79,14 +89,18 @@ public class TerrainShaderTests
{
var bake = AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Bake);
var coast = AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Coast);
- foreach (var t in new[] { bake, coast })
+ var ao = AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Ao);
+ foreach (var t in new[] { bake, coast, ao })
{
Assert.AreEqual(2048, t.width, t.name); Assert.AreEqual(2048, t.height, t.name);
Assert.IsFalse(t.isDataSRGB, t.name + " is data, not colour");
Assert.AreEqual(TextureWrapMode.Clamp, t.wrapMode, t.name);
Assert.Greater(t.mipmapCount, 1, t.name);
+ Assert.AreEqual(FilterMode.Trilinear, t.filterMode, t.name + ": no mip seams across the pitched view (review M5)");
}
+ Assert.AreEqual(2, bake.anisoLevel, "the bake is seen at a grazing angle");
Assert.AreEqual(TextureFormat.R8, coast.format, "one uncompressed channel: compression blocks would show in the foam band");
+ Assert.AreEqual(TextureFormat.R8, ao.format, "one uncompressed channel: BC1 banded the AO on broad slopes");
}
[Test]
@@ -103,6 +117,8 @@ public class TerrainShaderTests
var map = OpenMap();
var biome = Shader.GetGlobalTexture(MapShaderGlobals.Biome);
Assert.IsNotNull(biome); Assert.AreEqual(MapBuilder.BiomeTextureResolution, biome.width);
+ Assert.IsFalse(biome.isReadable, "no CPU copy of the 1024² texture stays on the heap (review M4)");
+ Assert.AreEqual(FilterMode.Trilinear, biome.filterMode, "no mip seams across the pitched view (review M5)");
var m = Shader.GetGlobalVector(MapShaderGlobals.Map);
Assert.AreEqual(map.Terrain.terrainData.size.x, m.x, 1f); Assert.AreEqual(map.Terrain.terrainData.size.z, m.y, 1f);
Assert.AreEqual(map.Hexes.hex_size_km * 1000f, Shader.GetGlobalVector(MapShaderGlobals.MapOrigin).w, 1e-3f);
@@ -130,8 +146,9 @@ public class TerrainShaderTests
/// <summary>Rendered over the Judean hills: the bakes (AO, curvature, sky-view) raise the relief's local contrast
/// (RenderSample.GradientEnergy) by at least 8% against a neutral bake (AO 1, curvature 0.5, sky 1). Local, not the
- /// frame's luma spread: this view takes in the Dead Sea, and the land-to-sea step dominates LumaStd, so the AO's overall
- /// darkening of the land lowers it (measured 0.0830 -> 0.0827) while the relief is visibly carved (gradient +13%).
+ /// frame's luma spread: this view takes in the Dead Sea (about 7% of the frame), whose land-to-sea step is about a
+ /// quarter to a third of the frame's variance and shrinks as the AO darkens the land, cancelling the relief's gain
+ /// (LumaStd measured 0.0830 -> 0.0827 while the gradient rose 13%).
/// Terrain.mat is changed in memory only and restored.</summary>
[UnityTest]
public IEnumerator TheBakesCarveTheRelief()
@@ -141,18 +158,18 @@ public class TerrainShaderTests
var cam = Camera.main; var rig = cam.GetComponent<CameraRig>();
rig.LookAt = map.Frame.ToWorld(35.25, 31.70, 0); rig.Distance = 45000f; rig.Yaw = 0; rig.TopInset = 0; rig.Apply();
var mat = AssetDatabase.LoadAssetAtPath<Material>(TerrainMatPath);
- var real = mat.GetTexture("_ScBakeTex");
+ var real = mat.GetTexture("_ScBakeTex"); var realAo = mat.GetTexture("_ScAoTex");
var neutral = new Texture2D(1, 1, TextureFormat.RGBA32, false, true);
neutral.SetPixel(0, 0, new Color(1f, 0.5f, 1f, 1f)); neutral.Apply();
try
{
var carved = RenderSample.Render(cam, 480, 270);
- mat.SetTexture("_ScBakeTex", neutral);
+ mat.SetTexture("_ScBakeTex", neutral); mat.SetTexture("_ScAoTex", Texture2D.whiteTexture);
var plain = RenderSample.Render(cam, 480, 270);
TestContext.WriteLine($"relief gradient {plain.GradientEnergy(0f, 1f):0.0000} -> {carved.GradientEnergy(0f, 1f):0.0000}");
Assert.Greater(carved.GradientEnergy(0f, 1f), plain.GradientEnergy(0f, 1f) * 1.08f);
}
- finally { mat.SetTexture("_ScBakeTex", real); Object.DestroyImmediate(neutral); }
+ finally { mat.SetTexture("_ScBakeTex", real); mat.SetTexture("_ScAoTex", realAo); Object.DestroyImmediate(neutral); }
}
/// <summary>Rendered at the country-wide pose: the haze moves the far (top) band more than the near (bottom) band. Both
@@ -174,4 +191,88 @@ public class TerrainShaderTests
TestContext.WriteLine($"haze shift far {far:0.000}, near {near:0.000}");
Assert.Greater(far, near + 0.005f);
}
+
+ /// <summary>Review I1: the haze is a depth cue, not a veil. At the country-wide pose the nearest land (bottom band,
+ /// about 205 km away) is inside the haze's start distance and barely moves; the middle and far bands move more and
+ /// more. Land column x 0.45..0.6, as in TheHazeThickensWithDistance.</summary>
+ [UnityTest]
+ public IEnumerator TheHazeStartsBeyondTheNearestDioramaLandAndGrowsWithDistance()
+ {
+ var map = OpenMap();
+ yield return null;
+ var cam = Camera.main; var rig = cam.GetComponent<CameraRig>();
+ PromoPose.Diorama02.Apply(rig, map.Frame); rig.TopInset = 0; rig.Apply();
+ VisualToggles.Set("haze", false); var clear = RenderSample.Render(cam, 480, 270);
+ VisualToggles.Set("haze", true); var hazy = RenderSample.Render(cam, 480, 270);
+ float Shift(float y0, float y1) => Mathf.Abs(hazy.MeanLuma(0.45f, y0, 0.6f, y1) - clear.MeanLuma(0.45f, y0, 0.6f, y1));
+ float near = Shift(0.05f, 0.2f), mid = Shift(0.425f, 0.575f), far = Shift(0.8f, 0.95f);
+ TestContext.WriteLine($"haze by distance near {near:0.0000}, mid {mid:0.0000}, far {far:0.0000}");
+ Assert.Less(near, 0.008f, "about no haze at the nearest land");
+ Assert.Greater(mid, near); Assert.Greater(far, mid + 0.005f);
+ }
+
+ /// <summary>Task 5 carry 3 / review A3: the AO the shader samples (ao.png) shows no compression banding. On broad
+ /// slopes (texels whose source steps by at most one 8-bit level to the east and north neighbours) the GPU-decoded
+ /// texture must not step by two levels or more between those neighbours on more than 2% of them, over the Judean
+ /// slopes and the Negev plateau. Measured on the BC1 terrain_bake.png R channel this failed (Judean slopes: 404 of 681
+ /// texels, 59%), so the AO is its own uncompressed R8 texture.</summary>
+ [Test]
+ public void TheCompressedAoShowsNoBandingOnBroadSlopes()
+ {
+ var ao = AssetDatabase.LoadAssetAtPath<Texture2D>(MapTexturePaths.Ao);
+ int n = ao.width;
+ var rt = RenderTexture.GetTemporary(n, n, 0, RenderTextureFormat.ARGBFloat, RenderTextureReadWrite.Linear);
+ var gpu = new Texture2D(n, n, TextureFormat.RGBAFloat, false, true);
+ var png = new Texture2D(2, 2, TextureFormat.RGBA32, false, true);
+ var prev = RenderTexture.active;
+ try
+ {
+ Graphics.Blit(ao, rt);
+ RenderTexture.active = rt; gpu.ReadPixels(new Rect(0, 0, n, n), 0, 0); gpu.Apply();
+ Assert.IsTrue(png.LoadImage(System.IO.File.ReadAllBytes(MapTexturePaths.Ao)));
+ Assert.AreEqual(n, png.width);
+ var d = gpu.GetPixels(); var s = png.GetPixels32();
+ var meta = JsonUtility.FromJson<HeightmapMeta>(System.IO.File.ReadAllText(System.IO.Path.Combine(Paths.StreamingMap, "heightmap.json")));
+ int X(double lon) => (int)((lon - meta.lon0) / (meta.lon1 - meta.lon0) * n);
+ int Y(double lat) => (int)((lat - meta.lat0) / (meta.lat1 - meta.lat0) * n); // texture row 0 is south
+ foreach (var (name, lon0, lon1, lat0, lat1) in new[] { ("Judean slopes", 35.05, 35.30, 31.60, 31.90), ("Negev plateau", 34.70, 35.10, 30.40, 30.80) })
+ {
+ int broad = 0, stepped = 0;
+ for (int y = Y(lat0) + 2; y < Y(lat1) - 2; y++)
+ for (int x = X(lon0) + 2; x < X(lon1) - 2; x++)
+ {
+ int S(int xx, int yy) => s[yy * n + xx].r;
+ // Broad: the source steps by at most one 8-bit level to both neighbours.
+ if (Mathf.Max(Mathf.Abs(S(x + 1, y) - S(x, y)), Mathf.Abs(S(x, y + 1) - S(x, y))) > 1) continue;
+ broad++;
+ float r = d[y * n + x].r;
+ float step = Mathf.Max(Mathf.Abs(d[y * n + x + 1].r - r), Mathf.Abs(d[(y + 1) * n + x].r - r)) * 255f;
+ if (step >= 2f - 1e-3f) stepped++;
+ }
+ float share = (float)stepped / Mathf.Max(1, broad);
+ TestContext.WriteLine($"AO banding {name}: {stepped} of {broad} broad-slope texels step >= 2 levels ({share:P2})");
+ Assert.Greater(broad, 500, name);
+ Assert.LessOrEqual(share, 0.02f, name);
+ }
+ }
+ finally
+ {
+ RenderTexture.active = prev; RenderTexture.ReleaseTemporary(rt);
+ Object.DestroyImmediate(gpu); Object.DestroyImmediate(png);
+ }
+ }
+
+ /// <summary>Review A3: the art checkpoint also shoots the 6 km hero zoom over the Judean slopes and the Negev plateau
+ /// (with the haze off), where AO steps would show; they are checks, not promo matches, so PromoPose.All (the profile's
+ /// and the editor capture's list) keeps its two poses.</summary>
+ [Test]
+ public void TheCheckpointShootsTheHeroZoomOverTheJudeanSlopesAndTheNegev()
+ {
+ var checks = PromoPose.CloseChecks;
+ CollectionAssert.AreEqual(new[] { "hero06judea", "hero06negev" }, checks.Select(p => p.Name).ToArray());
+ Assert.AreEqual((35.15, 31.78), (checks[0].Lon, checks[0].Lat));
+ Assert.AreEqual((34.90, 30.60), (checks[1].Lon, checks[1].Lat));
+ foreach (var p in checks) Assert.AreEqual(6000f, p.Distance, p.Name);
+ Assert.IsFalse(PromoPose.All.Any(p => checks.Any(c => c.Name == p.Name)));
+ }
}
diff --git a/unity/Assets/Textures/Map/ao.png b/unity/Assets/Textures/Map/ao.png
new file mode 100644
index 000000000..7a4219d3b
Binary files /dev/null and b/unity/Assets/Textures/Map/ao.png differ
diff --git a/unity/Assets/Textures/Map/ao.png.meta b/unity/Assets/Textures/Map/ao.png.meta
new file mode 100644
index 000000000..0761a359e
--- /dev/null
+++ b/unity/Assets/Textures/Map/ao.png.meta
@@ -0,0 +1,130 @@
+fileFormatVersion: 2
+guid: cceebd5d9c12d466089402a2361e524f
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 13
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ sRGBTexture: 0
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ flipGreenChannel: 0
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ ignoreMipmapLimit: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 2
+ aniso: 1
+ mipBias: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 1
+ nPOTScale: 1
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spritePixelsToUnits: 100
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spriteGenerateFallbackPhysicsShape: 1
+ alphaUsage: 1
+ alphaIsTransparency: 0
+ spriteTessellationDetail: -1
+ textureType: 10
+ textureShape: 1
+ singleChannelComponent: 1
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ swizzle: 50462976
+ cookieLightType: 0
+ platformSettings:
+ - serializedVersion: 4
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 4
+ buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 4
+ buildTarget: WebGL
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ customData:
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spriteCustomMetadata:
+ entries: []
+ nameFileIdTable: {}
+ mipmapLimitGroupName:
+ pSDRemoveMatte: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Textures/Map/coast.png.meta b/unity/Assets/Textures/Map/coast.png.meta
index 44b654e11..597b69c15 100644
--- a/unity/Assets/Textures/Map/coast.png.meta
+++ b/unity/Assets/Textures/Map/coast.png.meta
@@ -34,7 +34,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
- filterMode: 1
+ filterMode: 2
aniso: 1
mipBias: 0
wrapU: 1
diff --git a/unity/Assets/Textures/Map/terrain_bake.png.meta b/unity/Assets/Textures/Map/terrain_bake.png.meta
index 54fddeb0b..60008fabf 100644
--- a/unity/Assets/Textures/Map/terrain_bake.png.meta
+++ b/unity/Assets/Textures/Map/terrain_bake.png.meta
@@ -34,8 +34,8 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
- filterMode: 1
- aniso: 1
+ filterMode: 2
+ aniso: 2
mipBias: 0
wrapU: 1
wrapV: 1