fix(ShaderBake): 修正面片绕序与 MSAA 落地,补齐 _MainTex_ST 与菜单根

- 四边形原来按逆时针排三角,从默认相机方向看是背面,会被整片剔除
- MSAA 时落地目标也被建成多采样,Blit 写不进去;落地目标固定单采样
- flipY 是投影镜像,会让绕序反转,绘制期间同步翻转剔除方向
- applyUvToMainTexST 之前只有开关没有实现,改用属性块写 _MainTex_ST,不污染材质副本
- 编辑器非播放状态下 Object.Destroy 会被拒绝,JPG 压平纹理改走统一回收
- 注册路径补 ToolBar 根(XericLibrary/Tool),供烘焙窗口挂菜单
This commit is contained in:
2026-11-05 16:51:39 +08:00
parent 63173c6ec2
commit a769cbac00
7 changed files with 54 additions and 16 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ namespace XericUI.ShaderBake
name = source.name,
hideFlags = HideFlags.DontSave
};
CopyInto(source, texture);
CopyInto(source, texture, mipChain);
return texture;
}
@@ -33,13 +33,13 @@ namespace XericUI.ShaderBake
/// 读进一张已存在的纹理(尺寸要和 source 一致;不一致 Unity 只会填左上角,剩下留黑)。
/// 走 RenderTexture.active + ReadPixels,MSAA 目标已被调用方解析过,这里读到的是解析后的像素。
/// </summary>
public static void CopyInto(RenderTexture source, Texture2D destination)
public static void CopyInto(RenderTexture source, Texture2D destination, bool recalculateMipMaps = false)
{
RenderTexture previous = RenderTexture.active;
try
{
RenderTexture.active = source;
destination.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0, false);
destination.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0, recalculateMipMaps);
destination.Apply(false);
}
finally