unityzgy/.svn/pristine/bf/bf6d813406041ee9dedc41b7047a92b3bccc315a.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

115 lines
4.3 KiB
Plaintext

#if ENVIRO_LWRP
namespace UnityEngine.Rendering.LWRP
{
/// <summary>
/// Copy the given color buffer to the given destination color buffer.
///
/// You can use this pass to copy a color buffer to the destination,
/// so you can use it later in rendering. For example, you can copy
/// the opaque texture to use it for distortion effects.
/// </summary>
internal class EnviroBlitPass : UnityEngine.Rendering.Universal.ScriptableRenderPass
{
public enum RenderTarget
{
Color,
RenderTexture,
}
public Material blitMaterial = null;
public int blitShaderPassIndex = 0;
public FilterMode filterMode { get; set; }
private RenderTargetIdentifier source { get; set; }
private UnityEngine.Rendering.Universal.RenderTargetHandle destination { get; set; }
private RenderTexture setMainTexTo { get; set; }
private Material blit;
UnityEngine.Rendering.Universal.RenderTargetHandle m_TemporaryColorTexture;
string m_ProfilerTag;
/// <summary>
/// Create the CopyColorPass
/// </summary>
public EnviroBlitPass(UnityEngine.Rendering.Universal.RenderPassEvent renderPassEvent, Material blitMaterial, int blitShaderPassIndex, string tag)
{
this.renderPassEvent = renderPassEvent;
this.blitMaterial = blitMaterial;
this.blitShaderPassIndex = blitShaderPassIndex;
m_ProfilerTag = tag;
m_TemporaryColorTexture.Init("_TemporaryColorTexture");
}
/// <summary>
/// Configure the pass with the source and destination to execute on.
/// </summary>
/// <param name="source">Source Render Target</param>
/// <param name="destination">Destination Render Target</param>
public void Setup(RenderTargetIdentifier source, UnityEngine.Rendering.Universal.RenderTargetHandle destination)
{
this.source = source;
this.destination = destination;
}
/// <summary>
/// Configure the pass with the source and destination to execute on.
/// </summary>
/// <param name="source">Source Render Target</param>
/// <param name="destination">Destination Render Target</param>
public void Setup(RenderTargetIdentifier source, UnityEngine.Rendering.Universal.RenderTargetHandle destination, RenderTexture setTexTo)
{
this.source = source;
this.destination = destination;
this.setMainTexTo = setTexTo;
}
/// <inheritdoc/>
public override void Execute(ScriptableRenderContext context, ref UnityEngine.Rendering.Universal.RenderingData renderingData)
{
CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);
RenderTextureDescriptor opaqueDesc = renderingData.cameraData.cameraTargetDescriptor;
opaqueDesc.depthBufferBits = 0;
// Can't read and write to same color target, create a temp render target to blit.
if (destination == UnityEngine.Rendering.Universal.RenderTargetHandle.CameraTarget)
{
cmd.GetTemporaryRT(m_TemporaryColorTexture.id, opaqueDesc, filterMode);
RenderTargetIdentifier mainID;
if (setMainTexTo != null)
{
mainID = new RenderTargetIdentifier(setMainTexTo);
Blit(cmd, mainID, m_TemporaryColorTexture.Identifier(), blitMaterial, blitShaderPassIndex);
}
else
Blit(cmd, source, m_TemporaryColorTexture.Identifier(), blitMaterial, blitShaderPassIndex);
Blit(cmd, m_TemporaryColorTexture.Identifier(), source);
}
else
{
Blit(cmd, source, destination.Identifier(), blitMaterial, blitShaderPassIndex);
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
/// <inheritdoc/>
public override void FrameCleanup(CommandBuffer cmd)
{
if (destination == UnityEngine.Rendering.Universal.RenderTargetHandle.CameraTarget)
cmd.ReleaseTemporaryRT(m_TemporaryColorTexture.id);
}
}
}
#endif