您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
30 行
1.2 KiB
30 行
1.2 KiB
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEngine.Experimental.Rendering.LightweightPipeline
|
|
{
|
|
public class TransparentPostProcessPass : ScriptableRenderPass
|
|
{
|
|
|
|
public TransparentPostProcessPass(LightweightForwardRenderer renderer) : base(renderer)
|
|
{}
|
|
|
|
private RenderTargetHandle colorAttachmentHandle { get; set; }
|
|
private RenderTextureDescriptor descriptor { get; set; }
|
|
|
|
public void Setup(
|
|
RenderTextureDescriptor baseDescriptor,
|
|
RenderTargetHandle colorAttachmentHandle)
|
|
{
|
|
this.colorAttachmentHandle = colorAttachmentHandle;
|
|
descriptor = baseDescriptor;
|
|
}
|
|
|
|
public override void Execute(ref ScriptableRenderContext context, ref CullResults cullResults, ref RenderingData renderingData)
|
|
{
|
|
CommandBuffer cmd = CommandBufferPool.Get("Render PostProcess Effects");
|
|
LightweightPipeline.RenderPostProcess(cmd, renderer.postProcessRenderContext, ref renderingData.cameraData, descriptor.colorFormat, colorAttachmentHandle.Identifier(), BuiltinRenderTextureType.CameraTarget, false);
|
|
context.ExecuteCommandBuffer(cmd);
|
|
CommandBufferPool.Release(cmd);
|
|
}
|
|
}
|
|
}
|