Revert "feat(render): Campaign V slice V4d-1 - converge terrain's view and projection"

This reverts commit 0cb1059765.
This commit is contained in:
Erik 2026-07-27 22:38:02 +02:00
parent ad61f250fb
commit b537f3a952
2 changed files with 5 additions and 14 deletions

View file

@ -13,14 +13,8 @@ layout(location = 3) in uvec4 aPacked1;
layout(location = 4) in uvec4 aPacked2;
layout(location = 5) in uvec4 aPacked3;
// Campaign V slice V4d-1 (2026-07-27): uView/uProjection converged into the
// single uViewProjection that GpuPushConstants carries, so terrain can move
// onto the pinned push-constant block at V4d-2. The product is now formed on
// the CPU (camera.View * camera.Projection) instead of per vertex here; the
// two are the same transform, and System.Numerics' row-vector layout uploaded
// untransposed reads in GLSL as the transpose, so (View*Proj)^T == Proj^T *
// View^T is exactly the uProjection * uView this replaced.
uniform mat4 uViewProjection;
uniform mat4 uView;
uniform mat4 uProjection;
struct Light {
vec4 posAndKind;
@ -171,7 +165,7 @@ void main() {
// the un-nudged heightmap via TerrainSurface.SampleZ.
// Closes issue #100; supersedes the hiddenTerrainCells cell-collapse hack.
vec3 terrainPos = vec3(aPos.xy, aPos.z - 0.01);
gl_Position = uViewProjection * vec4(terrainPos, 1.0);
gl_Position = uProjection * uView * vec4(terrainPos, 1.0);
// Phase U.3: terrain clip gate against the single OutsideView region. With
// uTerrainClipCount == 0 (U.3 default) the first loop is skipped and the

View file

@ -501,11 +501,8 @@ public sealed unsafe class TerrainModernRenderer : IDisposable
// unified camera matrix everywhere, so no separate viewpoint divergence can occur.
_shader.Use();
UploadTextureTilingOnce();
// Campaign V slice V4d-1: one uViewProjection, matching the field
// GpuPushConstants already carries, instead of the separate uView and
// uProjection the shader used to combine per vertex. viewProjection is
// the same product the visibility pass above already computed.
_shader.SetMatrix4("uViewProjection", viewProjection);
_shader.SetMatrix4("uView", camera.View);
_shader.SetMatrix4("uProjection", camera.Projection);
var (terrainHandle, alphaHandle) = _atlas.GetBindlessHandles();
// Campaign V slice V2b: pass each handle's binding=9 table slot