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
@@ -120,16 +120,21 @@ namespace XericUI.ShaderBake
/// <summary>
/// 按当前设置造一张未被使用过的 RenderTexture(调用方负责销毁)。
/// <paramref name="samples"/> 传负数表示按设置走;解析目标必须显式传 1——
/// 往多采样目标上 Blit 是非法的,MSAA 那条路要靠"先画采样目标、再落地到单采样目标"。
/// </summary>
public RenderTexture CreateRenderTexture(string name = "ShaderBakeTarget")
public RenderTexture CreateRenderTexture(string name = "ShaderBakeTarget", int samples = -1)
{
Clamp();
int actualSamples = samples < 0 ? antiAliasing : SnapAntiAliasing(samples);
if (hdr && actualSamples > 1)
actualSamples = 1;
var rt = new RenderTexture(width, height, depthBuffer, format, renderTextureColorSpace)
{
name = name,
filterMode = filterMode,
wrapMode = wrapMode,
antiAliasing = antiAliasing,
antiAliasing = actualSamples,
hideFlags = HideFlags.DontSave
};
// 显式 Create:antiAliasing 只有在初始化之前赋值才生效,靠第一次使用时自动建就丢了