diff --git a/Editor/ShaderBake/BakeShaderAsImageWindow.cs b/Editor/ShaderBake/BakeShaderAsImageWindow.cs index 73e1a00..e7fe906 100644 --- a/Editor/ShaderBake/BakeShaderAsImageWindow.cs +++ b/Editor/ShaderBake/BakeShaderAsImageWindow.cs @@ -755,30 +755,12 @@ namespace XericUI.ShaderBake.Editor { faceInfo.text = meshMode ? "外部网格不参与面片点选" - : "选中第 " + (m_SelectedFace + 1) + " 格:UV (" + cell.uvX + ", " + cell.uvY + ")\n" + - FaceCornerText(surface, cell); + : "第 " + (m_SelectedFace + 1) + " 格 · UV (" + cell.uvX + ", " + cell.uvY + ")"; } SetFaceFieldsEnabled(!meshMode); UpdateFaceOverlay(); } - /// - /// 这一格四个顶点的实际 UV 写出来。"设为 UV0" 的约定就是四角落在 (0,0)(1,0)(0,1)(1,1), - /// 再乘重复、加偏移;把结果摊开显示,是不是这个范围一眼就能核对。 - /// - private static string FaceCornerText(ShaderBakeSurfaceSettings surface, ShaderBakeFaceCell cell) - { - Vector2 min = Vector2.Scale(new Vector2(cell.uvX, cell.uvY), surface.uvTiling) + surface.uvOffset; - Vector2 max = Vector2.Scale(new Vector2(cell.uvX + 1, cell.uvY + 1), surface.uvTiling) + surface.uvOffset; - return "四角 UV:(" + Corners(min.x, max.x) + ", " + Corners(min.y, max.y) + ")"; - } - - /// 一个轴的两个角值,左下在前 - private static string Corners(float low, float high) - { - return low.ToString("0.##") + " / " + high.ToString("0.##"); - } - private void SetFaceFieldsEnabled(bool enabled) { VisualElement x = rootVisualElement.Q("face-uv-x"); @@ -1034,43 +1016,24 @@ namespace XericUI.ShaderBake.Editor if (m_DebugView != DebugView.SolidColor) { - SetSelfTestNote("自检失败:纯色探针渲不出来 → 问题在渲染管线。" + DescribePipeline()); + SetSelfTestNote("自检失败:纯色探针画不出来"); return; } if (m_LastCoverage < 0f) { - SetSelfTestNote("自检读不回像素:显卡或纹理格式不支持这次采样"); + SetSelfTestNote("自检失败:读不回像素"); return; } if (m_LastCoverage <= 0.001f) { - SetSelfTestNote("自检未画出任何像素 → 问题在渲染管线。" + DescribePipeline() + - " 先按「框住面片」或「选中格铺满」再自检一次(探针固定 pass 0,pass 不背这个锅)。"); + SetSelfTestNote("自检失败:空画面"); SetStatus("管线自检:空画面"); return; } - SetSelfTestNote("自检通过:纯色面片盖住画面 " + Mathf.RoundToInt(m_LastCoverage * 100f) + - "%。管线是通的,画面空是被测 shader 自己的事(贴图、pass、混合模式、需要光照)"); + SetSelfTestNote("自检通过:覆盖 " + Mathf.RoundToInt(m_LastCoverage * 100f) + "%"); SetStatus("管线自检:正常"); } - /// - /// 把决定"画不画得见"的那几个数值摊开写一行。空画面的时候最缺的就是这个—— - /// 否则只能靠猜是相机框不住、面片太小还是 pass 选错。 - /// - private string DescribePipeline() - { - ShaderBakeSettings s = m_Renderer.settings; - return "正交=" + s.camera.orthographic + - " 半高=" + s.camera.orthographicSize.ToString("0.###") + - " 近/远=" + s.camera.nearClipPlane.ToString("0.###") + "/" + s.camera.farClipPlane.ToString("0.###") + - " 机位=" + s.camera.position + - " 面片=" + s.surface.gridColumns + "×" + s.surface.gridRows + " 格 尺寸=" + s.surface.size + - " 双面=" + s.surface.doubleSided + - " pass=" + s.output.shaderPass + "(探针固定用 0)" + - " 翻转Y=" + s.output.flipY; - } - private void SetSelfTestNote(string text) { Label note = rootVisualElement.Q