feat(ShaderBake): 不透明覆盖率读数、管线自检与贴图 ST 归位

"画面是棋盘格"这件事有两种完全不同的成因——什么都没画出来,和画出来但 alpha 为 0,
以前只能靠猜。现在:
- 每次渲染后降采样测一次不透明占比,写进预览读数和状态栏;
- 「管线自检」用 Unlit/Color 按同一套面片/相机/pass 再画一次,把问题分到管线还是被测 shader;
- 脚本造的临时材质里 Tiling 为 0 的贴图属性会被归位为 1(那等于把四个顶点 UV 乘成同一个点),
  并在属性表提示还有几张贴图没指定。
This commit is contained in:
2026-11-06 08:19:46 +08:00
parent dc5f2adae9
commit 632197b50e
5 changed files with 275 additions and 4 deletions
+7 -1
View File
@@ -154,6 +154,7 @@
<xer:IntegerField name="surf-submesh" label="SubMesh" class="field-full" />
<ui:Toggle name="surf-normalize" label="适配尺寸" class="field-toggle" />
<ui:Toggle name="surf-uv-st" label="写 _MainTex_ST" class="field-toggle" />
<ui:Toggle name="surf-double-sided" label="双面绘制" class="field-toggle" />
<ui:VisualElement class="field-row">
<ui:Button name="surf-reset" text="面片归位" class="field-half" />
<ui:Button name="surf-pick-scene" text="取选中物体" class="field-half" />
@@ -190,7 +191,12 @@
<xer:FloatField name="cam-rot-y" label="Y" class="field-third" />
<xer:FloatField name="cam-rot-z" label="Z" class="field-third" />
</ui:VisualElement>
<ui:Button name="cam-fit" text="框住面片" class="field-full" />
<ui:VisualElement class="field-row">
<ui:Button name="cam-fit" text="框住面片" class="field-half" />
<ui:Button name="cam-selftest" text="管线自检" class="field-half" />
</ui:VisualElement>
<ui:Label name="selftest-note" class="field-note"
text="自检:用不依赖贴图与光照的内置纯色 shader 按同一套矩阵画一次,用来分清是渲染管线的问题还是被测 shader 本身的问题" />
</ui:VisualElement>
</ui:VisualElement>