|
|
|
|
|
|
EnqueuePass(cmd, RenderPassHandles.LocalShadows, baseDescriptor); |
|
|
|
|
|
|
|
bool requiresDepthAttachment = requiresCameraDepth && !requiresDepthPrepass; |
|
|
|
bool requiresColorAttachment = RequiresColorAttachment(ref renderingData.cameraData, baseDescriptor) || requiresDepthAttachment; |
|
|
|
bool requiresColorAttachment = RequiresIntermediateColorTexture(ref renderingData.cameraData, baseDescriptor, requiresDepthAttachment); |
|
|
|
int[] colorHandles = (requiresColorAttachment) ? new[] {RenderTargetHandles.Color} : null; |
|
|
|
int depthHandle = (requiresColorAttachment) ? RenderTargetHandles.DepthAttachment : -1; |
|
|
|
EnqueuePass(cmd, RenderPassHandles.ForwardLit, baseDescriptor, colorHandles, depthHandle, renderingData.cameraData.msaaSamples); |
|
|
|
|
|
|
|
|
|
|
public RenderTargetIdentifier GetSurface(int handle) |
|
|
|
{ |
|
|
|
if (handle == -1) |
|
|
|
return BuiltinRenderTextureType.CameraTarget; |
|
|
|
|
|
|
|
if (handle < 0 || !m_ResourceMap.TryGetValue(handle, out renderTargetID)) |
|
|
|
if (!m_ResourceMap.TryGetValue(handle, out renderTargetID)) |
|
|
|
{ |
|
|
|
Debug.LogError(string.Format("Handle {0} has not any surface registered to it.", handle)); |
|
|
|
return new RenderTargetIdentifier(); |
|
|
|
|
|
|
m_ActiveRenderPassQueue.Add(pass); |
|
|
|
} |
|
|
|
|
|
|
|
bool RequiresColorAttachment(ref CameraData cameraData, RenderTextureDescriptor baseDescriptor) |
|
|
|
bool RequiresIntermediateColorTexture(ref CameraData cameraData, RenderTextureDescriptor baseDescriptor, bool requiresCameraDepth) |
|
|
|
if (cameraData.isOffscreenRender) |
|
|
|
return false; |
|
|
|
|
|
|
|
return cameraData.isSceneViewCamera || isScaledRender || cameraData.isHdrEnabled || |
|
|
|
return requiresCameraDepth || cameraData.isSceneViewCamera || isScaledRender || cameraData.isHdrEnabled || |
|
|
|
cameraData.postProcessEnabled || cameraData.requiresOpaqueTexture || isTargetTexture2DArray; |
|
|
|
} |
|
|
|
|
|
|
|