Tim Cooper
6 年前
当前提交
b751bcc7
共有 7 个文件被更改,包括 350 次插入 和 308 次删除
-
30Assets/Scripts/Rendering/WaterFXPass.cs
-
128Assets/scenes/Island.unity
-
20Packages/manifest.json
-
239Assets/Scripts/Rendering/PlanerReflections.cs
-
233Assets/Scripts/Rendering/MyLWRenderer.cs
-
8Assets/scenes/Testing/PackedPBR shader.meta
-
0/Assets/Scripts/Rendering/PlanerReflections.cs.meta
|
|||
using System; |
|||
using Unity.Mathematics; |
|||
using UnityEngine.Rendering; |
|||
using WaterSystem; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.LightweightPipeline |
|||
{ |
|||
[ImageEffectAllowedInSceneView] |
|||
public class PlanerReflections : MonoBehaviour, LightweightPipeline.IBeforeCameraRender |
|||
{ |
|||
[System.Serializable] |
|||
public enum ResolutionMulltiplier |
|||
{ |
|||
Full, |
|||
Half, |
|||
Third, |
|||
Quarter |
|||
} |
|||
|
|||
[System.Serializable] |
|||
public class PlanarReflectionSettings |
|||
{ |
|||
public ResolutionMulltiplier m_ResolutionMultiplier = ResolutionMulltiplier.Third; |
|||
public float m_ClipPlaneOffset = 0.07f; |
|||
public LayerMask m_ReflectLayers = -1; |
|||
} |
|||
|
|||
|
|||
[SerializeField] |
|||
public PlanarReflectionSettings m_settings = new PlanarReflectionSettings(); |
|||
|
|||
public GameObject target; |
|||
|
|||
private Camera m_ReflectionCamera; |
|||
private int2 m_TextureSize = new int2(256, 128); |
|||
private RenderTexture m_ReflectionTexture = null; |
|||
|
|||
|
|||
private int2 m_OldReflectionTextureSize; |
|||
|
|||
// Cleanup all the objects we possibly have created
|
|||
void OnDisable() |
|||
{ |
|||
if(m_ReflectionCamera) |
|||
{ |
|||
m_ReflectionCamera.targetTexture = null; |
|||
DestroyImmediate(m_ReflectionCamera.gameObject); |
|||
} |
|||
if (m_ReflectionTexture) |
|||
{ |
|||
DestroyImmediate(m_ReflectionTexture); |
|||
} |
|||
} |
|||
|
|||
private void UpdateCamera(Camera src, Camera dest) |
|||
{ |
|||
if (dest == null) |
|||
return; |
|||
// set camera to clear the same way as current camera
|
|||
dest.clearFlags = src.clearFlags; |
|||
dest.backgroundColor = src.backgroundColor; |
|||
// update other values to match current camera.
|
|||
// even if we are supplying custom camera&projection matrices,
|
|||
// some of values are used elsewhere (e.g. skybox uses far plane)
|
|||
dest.farClipPlane = src.farClipPlane; |
|||
dest.nearClipPlane = src.nearClipPlane; |
|||
dest.orthographic = src.orthographic; |
|||
dest.fieldOfView = src.fieldOfView; |
|||
dest.allowHDR = src.allowHDR; |
|||
dest.useOcclusionCulling = false; |
|||
dest.aspect = src.aspect; |
|||
dest.orthographicSize = src.orthographicSize; |
|||
} |
|||
|
|||
|
|||
private void UpdateReflectionCamera(Camera realCamera) |
|||
{ |
|||
if (m_ReflectionCamera == null) |
|||
m_ReflectionCamera = CreateMirrorObjects(realCamera); |
|||
|
|||
// find out the reflection plane: position and normal in world space
|
|||
Vector3 pos = target.transform.position; |
|||
Vector3 normal = target.transform.up; |
|||
|
|||
UpdateCamera(realCamera, m_ReflectionCamera); |
|||
|
|||
// Render reflection
|
|||
// Reflect camera around reflection plane
|
|||
float d = -Vector3.Dot(normal, pos) - m_settings.m_ClipPlaneOffset; |
|||
Vector4 reflectionPlane = new Vector4(normal.x, normal.y, normal.z, d); |
|||
|
|||
Matrix4x4 reflection = Matrix4x4.identity; |
|||
reflection *= Matrix4x4.Scale(new Vector3(1, -1, 1)); |
|||
|
|||
CalculateReflectionMatrix(ref reflection, reflectionPlane); |
|||
Vector3 oldpos = realCamera.transform.position - new Vector3(0, target.transform.position.y * 2, 0); |
|||
Vector3 newpos = ReflectPosition(oldpos); |
|||
m_ReflectionCamera.transform.forward = Vector3.Scale(realCamera.transform.forward, new Vector3(1, -1, 1)); |
|||
m_ReflectionCamera.worldToCameraMatrix = realCamera.worldToCameraMatrix * reflection; |
|||
|
|||
// Setup oblique projection matrix so that near plane is our reflection
|
|||
// plane. This way we clip everything below/above it for free.
|
|||
Vector4 clipPlane = CameraSpacePlane(m_ReflectionCamera, pos - Vector3.up * 0.1f, normal, 1.0f); |
|||
Matrix4x4 projection = realCamera.CalculateObliqueMatrix(clipPlane); |
|||
m_ReflectionCamera.projectionMatrix = projection; |
|||
m_ReflectionCamera.cullingMask = m_settings.m_ReflectLayers; // never render water layer
|
|||
m_ReflectionCamera.transform.position = newpos; |
|||
|
|||
} |
|||
|
|||
// Calculates reflection matrix around the given plane
|
|||
private static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane) |
|||
{ |
|||
reflectionMat.m00 = (1F - 2F * plane[0] * plane[0]); |
|||
reflectionMat.m01 = (-2F * plane[0] * plane[1]); |
|||
reflectionMat.m02 = (-2F * plane[0] * plane[2]); |
|||
reflectionMat.m03 = (-2F * plane[3] * plane[0]); |
|||
|
|||
reflectionMat.m10 = (-2F * plane[1] * plane[0]); |
|||
reflectionMat.m11 = (1F - 2F * plane[1] * plane[1]); |
|||
reflectionMat.m12 = (-2F * plane[1] * plane[2]); |
|||
reflectionMat.m13 = (-2F * plane[3] * plane[1]); |
|||
|
|||
reflectionMat.m20 = (-2F * plane[2] * plane[0]); |
|||
reflectionMat.m21 = (-2F * plane[2] * plane[1]); |
|||
reflectionMat.m22 = (1F - 2F * plane[2] * plane[2]); |
|||
reflectionMat.m23 = (-2F * plane[3] * plane[2]); |
|||
|
|||
reflectionMat.m30 = 0F; |
|||
reflectionMat.m31 = 0F; |
|||
reflectionMat.m32 = 0F; |
|||
reflectionMat.m33 = 1F; |
|||
} |
|||
|
|||
private static Vector3 ReflectPosition(Vector3 pos) |
|||
{ |
|||
Vector3 newPos = new Vector3(pos.x, -pos.y, pos.z); |
|||
return newPos; |
|||
} |
|||
|
|||
private float GetScaleValue() |
|||
{ |
|||
switch(m_settings.m_ResolutionMultiplier) |
|||
{ |
|||
case ResolutionMulltiplier.Full: |
|||
return 1f; |
|||
case ResolutionMulltiplier.Half: |
|||
return 0.5f; |
|||
case ResolutionMulltiplier.Third: |
|||
return 0.33f; |
|||
case ResolutionMulltiplier.Quarter: |
|||
return 0.25f; |
|||
} |
|||
return 0.5f; // default to half res
|
|||
} |
|||
|
|||
// Compare two int2
|
|||
private static bool Int2Compare(int2 a, int2 b) |
|||
{ |
|||
if(a.x == b.x && a.y == b.y) |
|||
return true; |
|||
else |
|||
return false; |
|||
} |
|||
|
|||
// Given position/normal of the plane, calculates plane in camera space.
|
|||
private Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign) |
|||
{ |
|||
Vector3 offsetPos = pos + normal * m_settings.m_ClipPlaneOffset; |
|||
Matrix4x4 m = cam.worldToCameraMatrix; |
|||
Vector3 cpos = m.MultiplyPoint(offsetPos); |
|||
Vector3 cnormal = m.MultiplyVector(normal).normalized * sideSign; |
|||
return new Vector4(cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot(cpos, cnormal)); |
|||
} |
|||
|
|||
private Camera CreateMirrorObjects(Camera currentCamera) |
|||
{ |
|||
LightweightPipelineAsset lwAsset = (LightweightPipelineAsset) GraphicsSettings.renderPipelineAsset; |
|||
var resMulti = lwAsset.renderScale * GetScaleValue(); |
|||
m_TextureSize.x = (int) Mathf.Pow(2, Mathf.RoundToInt(Mathf.Log(currentCamera.pixelWidth * resMulti, 2))); |
|||
m_TextureSize.y = (int) Mathf.Pow(2, Mathf.RoundToInt(Mathf.Log(currentCamera.pixelHeight * resMulti, 2))); |
|||
// Reflection render texture
|
|||
if (Int2Compare(m_TextureSize, m_OldReflectionTextureSize) || !m_ReflectionTexture) |
|||
{ |
|||
if (m_ReflectionTexture) |
|||
DestroyImmediate(m_ReflectionTexture); |
|||
m_ReflectionTexture = new RenderTexture(m_TextureSize.x, m_TextureSize.y, 16, |
|||
currentCamera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default); |
|||
m_ReflectionTexture.useMipMap = m_ReflectionTexture.autoGenerateMips = false; |
|||
m_ReflectionTexture.autoGenerateMips = false; // no need for mips(unless wanting cheap roughness)
|
|||
m_ReflectionTexture.name = "_PlanarReflection" + GetInstanceID(); |
|||
m_ReflectionTexture.isPowerOfTwo = true; |
|||
m_ReflectionTexture.hideFlags = HideFlags.DontSave; |
|||
m_OldReflectionTextureSize = m_TextureSize; |
|||
} |
|||
|
|||
m_ReflectionTexture.DiscardContents(); |
|||
|
|||
GameObject go = |
|||
new GameObject("Planar Refl Camera id" + GetInstanceID() + " for " + currentCamera.GetInstanceID(), |
|||
typeof(Camera), typeof(Skybox)); |
|||
LightweightAdditionalCameraData lwrpCamData = |
|||
go.AddComponent(typeof(LightweightAdditionalCameraData)) as LightweightAdditionalCameraData; |
|||
lwrpCamData.renderShadows = false; // turn off shadows for the reflection camera
|
|||
var reflectionCamera = go.GetComponent<Camera>(); |
|||
reflectionCamera.transform.SetPositionAndRotation(transform.position, transform.rotation); |
|||
reflectionCamera.targetTexture = m_ReflectionTexture; |
|||
reflectionCamera.allowMSAA = true; |
|||
reflectionCamera.depth = -10; |
|||
reflectionCamera.enabled = false; |
|||
go.hideFlags = HideFlags.HideAndDontSave; |
|||
|
|||
Shader.SetGlobalTexture("_PlanarReflectionTexture", m_ReflectionTexture); |
|||
return reflectionCamera; |
|||
} |
|||
|
|||
public void ExecuteBeforeCameraRender( |
|||
ScriptableRenderContext context, |
|||
Camera camera, |
|||
LightweightPipeline.PipelineSettings pipelineSettings, |
|||
LightweightRenderer renderer) |
|||
{ |
|||
|
|||
if (!enabled) |
|||
return; |
|||
|
|||
GL.invertCulling = true; |
|||
RenderSettings.fog = false; |
|||
|
|||
UpdateReflectionCamera(camera); |
|||
|
|||
CullResults cullResults = new CullResults(); |
|||
LightweightPipeline.RenderSingleCamera(context, pipelineSettings, m_ReflectionCamera, ref cullResults, new DefaultRendererSetup(), renderer); |
|||
|
|||
GL.invertCulling = false; |
|||
RenderSettings.fog = true; |
|||
} |
|||
} |
|||
} |
|
|||
using System; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.LightweightPipeline |
|||
{ |
|||
public class MyLWRenderer : MonoBehaviour, IRendererSetup |
|||
{ |
|||
private DepthOnlyPass m_DepthOnlyPass; |
|||
private DirectionalShadowsPass m_DirectionalShadowPass; |
|||
private LocalShadowsPass m_LocalShadowPass; |
|||
private SetupForwardRenderingPass m_SetupForwardRenderingPass; |
|||
private ScreenSpaceShadowResolvePass m_ScreenSpaceShadowResovePass; |
|||
private CreateLightweightRenderTexturesPass m_CreateLightweightRenderTexturesPass; |
|||
private BeginXRRenderingPass m_BeginXrRenderingPass; |
|||
private SetupLightweightConstanstPass m_SetupLightweightConstants; |
|||
private RenderOpaqueForwardPass m_RenderOpaqueForwardPass; |
|||
private OpaquePostProcessPass m_OpaquePostProcessPass; |
|||
private DrawSkyboxPass m_DrawSkyboxPass; |
|||
private CopyDepthPass m_CopyDepthPass; |
|||
private CopyColorPass m_CopyColorPass; |
|||
private RenderTransparentForwardPass m_RenderTransparentForwardPass; |
|||
private TransparentPostProcessPass m_TransparentPostProcessPass; |
|||
private FinalBlitPass m_FinalBlitPass; |
|||
private EndXRRenderingPass m_EndXrRenderingPass; |
|||
|
|||
private WaterFXPass m_WaterFXPass; |
|||
|
|||
#if UNITY_EDITOR
|
|||
private SceneViewDepthCopyPass m_SceneViewDepthCopyPass; |
|||
#endif
|
|||
|
|||
|
|||
private RenderTargetHandle Color; |
|||
private RenderTargetHandle DepthAttachment; |
|||
private RenderTargetHandle DepthTexture; |
|||
private RenderTargetHandle OpaqueColor; |
|||
private RenderTargetHandle DirectionalShadowmap; |
|||
private RenderTargetHandle LocalShadowmap; |
|||
private RenderTargetHandle ScreenSpaceShadowmap; |
|||
|
|||
[NonSerialized] |
|||
private bool m_Initialized = false; |
|||
|
|||
public bool m_addToSceneCamera = true; |
|||
|
|||
|
|||
private void Init(LightweightForwardRenderer renderer) |
|||
{ |
|||
if (m_Initialized) |
|||
return; |
|||
|
|||
// Add this custom renderer component to the scene camera(I'm not looking at removing so could cause issues)
|
|||
if(m_addToSceneCamera) |
|||
{ |
|||
Object[] cameras = Resources.FindObjectsOfTypeAll(typeof(Camera)); |
|||
for (var i = 0; i < cameras.Length; i++) |
|||
{ |
|||
Camera cam = cameras[i] as Camera; |
|||
if(cam.cameraType == CameraType.SceneView) |
|||
{ |
|||
if(cam.gameObject.GetComponent(this.GetType()) == null) |
|||
{ |
|||
cam.gameObject.AddComponent(this.GetType()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
m_DepthOnlyPass = new DepthOnlyPass(); |
|||
m_DirectionalShadowPass = new DirectionalShadowsPass(); |
|||
m_LocalShadowPass = new LocalShadowsPass(); |
|||
m_SetupForwardRenderingPass = new SetupForwardRenderingPass(); |
|||
m_ScreenSpaceShadowResovePass = new ScreenSpaceShadowResolvePass(renderer.GetMaterial(MaterialHandles.ScrenSpaceShadow)); |
|||
m_CreateLightweightRenderTexturesPass = new CreateLightweightRenderTexturesPass(); |
|||
m_BeginXrRenderingPass = new BeginXRRenderingPass(); |
|||
m_SetupLightweightConstants = new SetupLightweightConstanstPass(); |
|||
m_RenderOpaqueForwardPass = new RenderOpaqueForwardPass(renderer.GetMaterial(MaterialHandles.Error)); |
|||
m_OpaquePostProcessPass = new OpaquePostProcessPass(); |
|||
m_DrawSkyboxPass = new DrawSkyboxPass(); |
|||
m_CopyDepthPass = new CopyDepthPass(renderer.GetMaterial(MaterialHandles.DepthCopy)); |
|||
m_CopyColorPass = new CopyColorPass(renderer.GetMaterial(MaterialHandles.Sampling)); |
|||
m_RenderTransparentForwardPass = new RenderTransparentForwardPass(renderer.GetMaterial(MaterialHandles.Error)); |
|||
m_TransparentPostProcessPass = new TransparentPostProcessPass(); |
|||
m_FinalBlitPass = new FinalBlitPass(renderer.GetMaterial(MaterialHandles.Blit)); |
|||
m_EndXrRenderingPass = new EndXRRenderingPass(); |
|||
|
|||
m_WaterFXPass = new WaterFXPass(); |
|||
|
|||
#if UNITY_EDITOR
|
|||
m_SceneViewDepthCopyPass = new SceneViewDepthCopyPass(renderer.GetMaterial(MaterialHandles.DepthCopy)); |
|||
#endif
|
|||
|
|||
// RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
|
|||
// Samples (MSAA) depend on camera and pipeline
|
|||
Color.Init("_CameraColorTexture"); |
|||
DepthAttachment.Init("_CameraDepthAttachment"); |
|||
DepthTexture.Init("_CameraDepthTexture"); |
|||
OpaqueColor.Init("_CameraOpaqueTexture"); |
|||
DirectionalShadowmap.Init("_DirectionalShadowmapTexture"); |
|||
LocalShadowmap.Init("_LocalShadowmapTexture"); |
|||
ScreenSpaceShadowmap.Init("_ScreenSpaceShadowMapTexture"); |
|||
|
|||
m_Initialized = true; |
|||
} |
|||
|
|||
public void Setup(LightweightForwardRenderer renderer, ref ScriptableRenderContext context, |
|||
ref CullResults cullResults, ref RenderingData renderingData) |
|||
{ |
|||
Init(renderer); |
|||
|
|||
renderer.Clear(); |
|||
|
|||
renderer.SetupPerObjectLightIndices(ref cullResults, ref renderingData.lightData); |
|||
RenderTextureDescriptor baseDescriptor = LightweightForwardRenderer.CreateRTDesc(ref renderingData.cameraData); |
|||
RenderTextureDescriptor shadowDescriptor = baseDescriptor; |
|||
shadowDescriptor.dimension = TextureDimension.Tex2D; |
|||
|
|||
bool requiresCameraDepth = renderingData.cameraData.requiresDepthTexture; |
|||
bool requiresDepthPrepass = renderingData.shadowData.requiresScreenSpaceShadowResolve || |
|||
renderingData.cameraData.isSceneViewCamera || |
|||
(requiresCameraDepth && |
|||
!LightweightForwardRenderer.CanCopyDepth(ref renderingData.cameraData)); |
|||
|
|||
// For now VR requires a depth prepass until we figure out how to properly resolve texture2DMS in stereo
|
|||
requiresDepthPrepass |= renderingData.cameraData.isStereoEnabled; |
|||
|
|||
if (renderingData.shadowData.renderDirectionalShadows) |
|||
{ |
|||
m_DirectionalShadowPass.Setup(DirectionalShadowmap); |
|||
renderer.EnqueuePass(m_DirectionalShadowPass); |
|||
} |
|||
|
|||
if (renderingData.shadowData.renderLocalShadows) |
|||
{ |
|||
|
|||
m_LocalShadowPass.Setup(LocalShadowmap, renderer.maxVisibleLocalLights); |
|||
renderer.EnqueuePass(m_LocalShadowPass); |
|||
} |
|||
|
|||
renderer.EnqueuePass(m_SetupForwardRenderingPass); |
|||
|
|||
if (requiresDepthPrepass) |
|||
{ |
|||
m_DepthOnlyPass.Setup(baseDescriptor, DepthTexture, SampleCount.One); |
|||
renderer.EnqueuePass(m_DepthOnlyPass); |
|||
} |
|||
|
|||
if (renderingData.shadowData.renderDirectionalShadows && |
|||
renderingData.shadowData.requiresScreenSpaceShadowResolve) |
|||
{ |
|||
m_ScreenSpaceShadowResovePass.Setup(baseDescriptor, ScreenSpaceShadowmap); |
|||
renderer.EnqueuePass(m_ScreenSpaceShadowResovePass); |
|||
} |
|||
|
|||
bool requiresDepthAttachment = requiresCameraDepth && !requiresDepthPrepass; |
|||
bool requiresColorAttachment = |
|||
LightweightForwardRenderer.RequiresIntermediateColorTexture( |
|||
ref renderingData.cameraData, |
|||
baseDescriptor, |
|||
requiresDepthAttachment); |
|||
RenderTargetHandle colorHandle = (requiresColorAttachment) ? Color : RenderTargetHandle.CameraTarget; |
|||
RenderTargetHandle depthHandle = (requiresDepthAttachment) ? DepthAttachment : RenderTargetHandle.CameraTarget; |
|||
|
|||
var sampleCount = (SampleCount) renderingData.cameraData.msaaSamples; |
|||
m_CreateLightweightRenderTexturesPass.Setup(baseDescriptor, colorHandle, depthHandle, sampleCount); |
|||
renderer.EnqueuePass(m_CreateLightweightRenderTexturesPass); |
|||
|
|||
if (renderingData.cameraData.isStereoEnabled) |
|||
renderer.EnqueuePass(m_BeginXrRenderingPass); |
|||
|
|||
Camera camera = renderingData.cameraData.camera; |
|||
bool dynamicBatching = renderingData.supportsDynamicBatching; |
|||
RendererConfiguration rendererConfiguration = LightweightForwardRenderer.GetRendererConfiguration(renderingData.lightData.totalAdditionalLightsCount); |
|||
|
|||
m_SetupLightweightConstants.Setup(renderer.maxVisibleLocalLights, renderer.perObjectLightIndices); |
|||
renderer.EnqueuePass(m_SetupLightweightConstants); |
|||
|
|||
m_RenderOpaqueForwardPass.Setup(baseDescriptor, colorHandle, depthHandle, LightweightForwardRenderer.GetCameraClearFlag(camera), camera.backgroundColor, rendererConfiguration,dynamicBatching); |
|||
renderer.EnqueuePass(m_RenderOpaqueForwardPass); |
|||
|
|||
if (renderingData.cameraData.postProcessEnabled && |
|||
renderingData.cameraData.postProcessLayer.HasOpaqueOnlyEffects(renderer.postProcessRenderContext)) |
|||
{ |
|||
m_OpaquePostProcessPass.Setup(renderer.postProcessRenderContext, baseDescriptor, colorHandle); |
|||
renderer.EnqueuePass(m_OpaquePostProcessPass); |
|||
} |
|||
|
|||
if (camera.clearFlags == CameraClearFlags.Skybox) |
|||
renderer.EnqueuePass(m_DrawSkyboxPass); |
|||
|
|||
if (depthHandle != RenderTargetHandle.CameraTarget) |
|||
{ |
|||
m_CopyDepthPass.Setup(depthHandle, DepthTexture); |
|||
renderer.EnqueuePass(m_CopyDepthPass); |
|||
} |
|||
|
|||
if (renderingData.cameraData.requiresOpaqueTexture) |
|||
{ |
|||
m_CopyColorPass.Setup(colorHandle, OpaqueColor); |
|||
renderer.EnqueuePass(m_CopyColorPass); |
|||
} |
|||
|
|||
renderer.EnqueuePass(m_WaterFXPass); |
|||
|
|||
m_RenderTransparentForwardPass.Setup(baseDescriptor, colorHandle, depthHandle, ClearFlag.None, camera.backgroundColor, rendererConfiguration, dynamicBatching); |
|||
renderer.EnqueuePass(m_RenderTransparentForwardPass); |
|||
|
|||
if (renderingData.cameraData.postProcessEnabled) |
|||
{ |
|||
m_TransparentPostProcessPass.Setup(renderer.postProcessRenderContext, baseDescriptor, colorHandle); |
|||
renderer.EnqueuePass(m_TransparentPostProcessPass); |
|||
} |
|||
else if (!renderingData.cameraData.isOffscreenRender && colorHandle != RenderTargetHandle.CameraTarget) |
|||
{ |
|||
m_FinalBlitPass.Setup(baseDescriptor, colorHandle); |
|||
renderer.EnqueuePass(m_FinalBlitPass); |
|||
} |
|||
|
|||
if (renderingData.cameraData.isStereoEnabled) |
|||
{ |
|||
renderer.EnqueuePass(m_EndXrRenderingPass); |
|||
} |
|||
|
|||
#if UNITY_EDITOR
|
|||
if (renderingData.cameraData.isSceneViewCamera) |
|||
{ |
|||
m_SceneViewDepthCopyPass.Setup(DepthTexture); |
|||
renderer.EnqueuePass(m_SceneViewDepthCopyPass); |
|||
} |
|||
#endif
|
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 77a2fc799d4174f6296bedcb42fe5097 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue