Felipe Lira
7 年前
当前提交
9a5ecd7b
共有 6 个文件被更改,包括 172 次插入 和 68 次删除
-
64ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
-
36ScriptableRenderPipeline/LightweightPipeline/LWRP/Passes/DepthOnlyPass.cs
-
26ScriptableRenderPipeline/LightweightPipeline/LWRP/Passes/ScriptableRenderPass.cs
-
42ScriptableRenderPipeline/LightweightPipeline/LWRP/Passes/ShadowPass.cs
-
61ScriptableRenderPipeline/LightweightPipeline/LWRP/ForwardRenderer.cs
-
11ScriptableRenderPipeline/LightweightPipeline/LWRP/ForwardRenderer.cs.meta
|
|||
using System.Collections.Generic; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.LightweightPipeline |
|||
{ |
|||
public static class RenderTargetHandle |
|||
{ |
|||
public static int Color; |
|||
public static int Depth; |
|||
public static int DepthMS; |
|||
public static int OpaqueColor; |
|||
public static int DirectionalShadowmap; |
|||
public static int LocalShadowmap; |
|||
public static int ScreenSpaceOcclusion; |
|||
} |
|||
|
|||
|
|||
public class ForwardRenderer |
|||
{ |
|||
private Dictionary<int, RenderTargetIdentifier> m_ResourceMap = new Dictionary<int, RenderTargetIdentifier>(); |
|||
private List<ScriptableRenderPass> m_Passes = new List<ScriptableRenderPass>(); |
|||
private List<ScriptableRenderPass> m_Graph = new List<ScriptableRenderPass>(); |
|||
|
|||
public ForwardRenderer() |
|||
{ |
|||
// RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
|
|||
// Samples (MSAA) depend on camera and pipeline
|
|||
RenderTargetHandle.Color = Shader.PropertyToID("_CameraColorTexture"); |
|||
RenderTargetHandle.Depth = Shader.PropertyToID("_CameraDepthTexture"); |
|||
RenderTargetHandle.DepthMS = Shader.PropertyToID("_CameraDepthMSTexture"); |
|||
RenderTargetHandle.OpaqueColor = Shader.PropertyToID("_CameraOpaqueTexture"); |
|||
RenderTargetHandle.DirectionalShadowmap = Shader.PropertyToID("_DirectionalShadowmapTexture"); |
|||
RenderTargetHandle.LocalShadowmap = Shader.PropertyToID("_LocalShadowmapTexture"); |
|||
RenderTargetHandle.ScreenSpaceOcclusion = Shader.PropertyToID("_ScreenSpaceShadowMapTexture"); |
|||
|
|||
m_ResourceMap.Add(RenderTargetHandle.Color, new RenderTargetIdentifier(RenderTargetHandle.Color)); |
|||
m_ResourceMap.Add(RenderTargetHandle.Depth, new RenderTargetIdentifier(RenderTargetHandle.Depth)); |
|||
m_ResourceMap.Add(RenderTargetHandle.DepthMS, new RenderTargetIdentifier(RenderTargetHandle.DepthMS)); |
|||
m_ResourceMap.Add(RenderTargetHandle.OpaqueColor, new RenderTargetIdentifier(RenderTargetHandle.OpaqueColor)); |
|||
m_ResourceMap.Add(RenderTargetHandle.DirectionalShadowmap, new RenderTargetIdentifier(RenderTargetHandle.DirectionalShadowmap)); |
|||
m_ResourceMap.Add(RenderTargetHandle.LocalShadowmap, new RenderTargetIdentifier(RenderTargetHandle.LocalShadowmap)); |
|||
m_ResourceMap.Add(RenderTargetHandle.ScreenSpaceOcclusion, new RenderTargetIdentifier(RenderTargetHandle.ScreenSpaceOcclusion)); |
|||
} |
|||
|
|||
public void AddPass(ScriptableRenderPass pass) |
|||
{ |
|||
m_Passes.Add(pass); |
|||
} |
|||
|
|||
public List<ScriptableRenderPass> BuildRenderGraph() |
|||
{ |
|||
m_Graph.Clear(); |
|||
return m_Graph; |
|||
} |
|||
|
|||
public RenderTargetIdentifier GetSurface(int handle) |
|||
{ |
|||
return m_ResourceMap[handle]; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 83797c942458af1439f0f02f681ee8c9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue