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

@@ -135,11 +135,27 @@ func (r *Registry) IsTranslucent(s State) bool { return r.Get(s.ID()).Translucen
func (r *Registry) IsFluid(s State) bool { return r.Get(s.ID()).Fluid }
// Texture 取方块某个面的纹理键(如 "up"/"side"/"all")。
// 原版 blocks.json 惯例:四个侧面统一用 "side"(南面可用 "front" 覆盖,如熔炉)。
// mesh 层传入 east/west/south/north 方位名,这里回退到 side/front,
// 否则 grass_block 等立面会落到 "block/<name>"(图集中不存在)→ 全图集灰块。
func (r *Registry) Texture(s State, face string) string {
d := r.Get(s.ID())
if t, ok := d.Textures[face]; ok {
return t
}
switch face {
case "south": // 南面优先 front(熔炉门面),其次 side
if t, ok := d.Textures["front"]; ok {
return t
}
if t, ok := d.Textures["side"]; ok {
return t
}
case "east", "west", "north":
if t, ok := d.Textures["side"]; ok {
return t
}
}
if t, ok := d.Textures["all"]; ok {
return t
}