fix(render): 垂直面渲染恢复——绕序改回窗口空间 CW + 侧面纹理键回退

- 六面绕序按 GL 窗口坐标(x 右、y 上)验证:曾按 y 向下约定反转五面,
  垂直面全部变成背面被剔除(只有顶面渲染、透空见区块断面)
- mesh.TestFaceWinding 鞋带公式回归测试锁死绕序约定
- Registry.Texture 对 east/west/north 回退 side、south 回退 front/side
  (原版 blocks.json 惯例),立面不再落到不存在的 block/<name> 灰块
- World.SetBlock 破坏/放置空气时按列重算天空光(洞壁不再全黑)
This commit is contained in:
NianGao Dev
2026-08-16 22:32:07 +08:00
parent c0c8ba75fc
commit 95bd510bf8
6 changed files with 76 additions and 13 deletions

View File

@@ -15,14 +15,14 @@ import (
)
// cubeFaces 单位立方体 6 面角顺序(与 mesh.faceDef 一致,
// 窗口空间 CW 绕序为 FrontFace(CW) 的正面)。
// 窗口空间 CW 绕序为 FrontFace(CW) 的正面;窗口坐标 y 向上)。
var cubeFaces = [6][4][3]float32{
{{0, 1, 0}, {1, 1, 0}, {1, 1, 1}, {0, 1, 1}}, // 顶
{{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, // 底(反向)
{{1, 1, 0}, {1, 1, 1}, {1, 0, 1}, {1, 0, 0}}, // 东(+x)(反向)
{{0, 1, 1}, {0, 1, 0}, {0, 0, 0}, {0, 0, 1}}, // 西(-x)(反向)
{{1, 1, 1}, {0, 1, 1}, {0, 0, 1}, {1, 0, 1}}, // 南(+z)(反向)
{{0, 1, 0}, {1, 1, 0}, {1, 0, 0}, {0, 0, 0}}, // 北(-z)(反向)
{{0, 0, 1}, {1, 0, 1}, {1, 0, 0}, {0, 0, 0}}, // 底
{{1, 0, 0}, {1, 0, 1}, {1, 1, 1}, {1, 1, 0}}, // 东(+x)
{{0, 0, 1}, {0, 0, 0}, {0, 1, 0}, {0, 1, 1}}, // 西(-x)
{{1, 0, 1}, {0, 0, 1}, {0, 1, 1}, {1, 1, 1}}, // 南(+z)
{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, // 北(-z)
}
// cubeVerts 按六面 UV 构建单位立方体顶点(mesh.Vertex 格式:pos+uv+light 字节,