您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
1.2 KiB
29 行
1.2 KiB
using UnityEngine.Experimental.Rendering;
|
|
using UnityEngine.Experimental.Rendering.LightweightPipeline;
|
|
|
|
namespace UnityEngine.XR.ARFoundation
|
|
{
|
|
public class LWRPBeforeCameraRender : MonoBehaviour, IBeforeRender
|
|
{
|
|
const string k_ARBlitTag = "ARBackground Blit Pass";
|
|
|
|
public Material blitMaterial { get; set; }
|
|
|
|
/// <summary>
|
|
/// Create, setup and return a ScriptableRenderPass that will blit the pass-thru video when this GameObject is rendered.
|
|
/// </summary>
|
|
/// <param name="baseDescriptor">RenderTextureDescriptor for this pass. </param>
|
|
/// <param name="colorHandle">RenderTargetHandle for color buffer.</param>
|
|
/// <param name="depthHandle">RenderTargetHandle for depth buffer.</param>
|
|
/// <param name="clearFlag">ClearFlag used for rendering.</param>
|
|
/// <returns></returns>
|
|
public ScriptableRenderPass GetPassToEnqueue(RenderTextureDescriptor baseDescriptor, RenderTargetHandle colorHandle,
|
|
RenderTargetHandle depthHandle, ClearFlag clearFlag)
|
|
{
|
|
var lwrpBackgroundRenderPass = new LWRPBackgroundRenderPass();
|
|
lwrpBackgroundRenderPass.Setup(blitMaterial, colorHandle.Identifier(), depthHandle.Identifier(),
|
|
baseDescriptor);
|
|
return lwrpBackgroundRenderPass;
|
|
}
|
|
}
|
|
}
|