fix(ShaderBake): 框住改为刚好铺满,烘出的图不再留白边

原来框住量的是整个网格再加 15% 余量,默认半高又是 0.6:
1×1 的面片在 512 输出里只占 71%,四周一圈透明——和场景里把材质贴在
面片上正对着看不是一个范围。现在框住的余量取 1,默认半高 0.5,
刚好顶满画面。旧存档带着 fitRevision 0,开窗时按新约定重框一次。
This commit is contained in:
2026-11-07 09:05:10 +08:00
parent 6896e830b9
commit 2a6f981dc7
2 changed files with 16 additions and 2 deletions
+4 -1
View File
@@ -154,7 +154,9 @@ namespace XericUI.ShaderBake
EnsureGeometry();
if (m_Geometry == null)
return;
settings.camera.FrameBounds(geometryBounds, settings.aspect);
// 余量给 1:烘出来的图和场景里"把材质贴在面片上正对着看"是一个范围,不留白边
settings.camera.FrameBounds(geometryBounds, settings.aspect, 1f);
settings.camera.fitRevision = ShaderBakeCameraSettings.kCurrentFitRevision;
}
/// <summary>
@@ -172,6 +174,7 @@ namespace XericUI.ShaderBake
return false;
// padding 给 1:这一格就是要铺满整张输出图,留边就等于把内容缩小
settings.camera.FrameBounds(bounds, settings.aspect, 1f);
settings.camera.fitRevision = ShaderBakeCameraSettings.kCurrentFitRevision;
return true;
}