refactor: update text wrapping mode in RobotBootSequence and clean up CRTRendererFeature

This commit is contained in:
Thibault Pouch
2026-03-13 19:28:03 +01:00
parent f42463176f
commit 64b2d63799
2 changed files with 2 additions and 52 deletions

View File

@@ -257,7 +257,7 @@ public class RobotBootSequence : MonoBehaviour
text.fontSize = 40f; text.fontSize = 40f;
text.alignment = TextAlignmentOptions.Left; text.alignment = TextAlignmentOptions.Left;
text.color = BootTextColor; text.color = BootTextColor;
text.enableWordWrapping = true; text.textWrappingMode = TextWrappingModes.Normal;
return text; return text;
} }

View File

@@ -25,11 +25,8 @@ public class CRTRendererFeature : ScriptableRendererFeature
class CRTPass : ScriptableRenderPass class CRTPass : ScriptableRenderPass
{ {
private readonly ProfilingSampler m_ProfilingSampler = new("CRT Effect");
private Material m_Material; private Material m_Material;
private CRTSettings m_Settings; private CRTSettings m_Settings;
private RTHandle m_TempColorTexture;
public void Setup(Material material, CRTSettings settings) public void Setup(Material material, CRTSettings settings)
{ {
@@ -73,56 +70,9 @@ public class CRTRendererFeature : ScriptableRendererFeature
resourceData.cameraColor = destination; resourceData.cameraColor = destination;
} }
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
{
cameraTextureDescriptor.depthBufferBits = 0;
RenderingUtils.ReAllocateHandleIfNeeded(
ref m_TempColorTexture,
cameraTextureDescriptor,
FilterMode.Bilinear,
TextureWrapMode.Clamp,
name: "_CRTTempColorTexture"
);
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
if (m_Material == null || m_Settings == null || !m_Settings.EffectEnabled)
{
return;
}
if (renderingData.cameraData.isSceneViewCamera)
{
return;
}
CommandBuffer cmd = CommandBufferPool.Get();
using (new ProfilingScope(cmd, m_ProfilingSampler))
{
m_Material.SetFloat("_Intensity", m_Settings.Intensity);
m_Material.SetFloat("_ScanlineDensity", m_Settings.ScanlineDensity);
m_Material.SetFloat("_ScanlineStrength", m_Settings.ScanlineStrength);
m_Material.SetFloat("_Curvature", m_Settings.Curvature);
m_Material.SetFloat("_VignetteStrength", m_Settings.VignetteStrength);
m_Material.SetFloat("_ChromaticAberration", m_Settings.ChromaticAberration);
m_Material.SetFloat("_NoiseStrength", m_Settings.NoiseStrength);
m_Material.SetFloat("_FlickerStrength", m_Settings.FlickerStrength);
RTHandle source = renderingData.cameraData.renderer.cameraColorTargetHandle;
Blitter.BlitCameraTexture(cmd, source, m_TempColorTexture, m_Material, 0);
Blitter.BlitCameraTexture(cmd, m_TempColorTexture, source);
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
public void Dispose() public void Dispose()
{ {
m_TempColorTexture?.Release(); // RenderGraph path does not allocate persistent RTHandles in this pass.
m_TempColorTexture = null;
} }
} }