|
|
|
|
|
|
|
|
|
|
string[] tileKeywords = {"LIGHTLOOP_TILE_DIRECT", "LIGHTLOOP_TILE_INDIRECT", "LIGHTLOOP_TILE_ALL"}; |
|
|
|
|
|
|
|
m_DeferredDirectMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredDirectMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredDirectMaterialSRT, tileKeywords, 0); |
|
|
|
m_DeferredDirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredDirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredDirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero); |
|
|
|
|
|
|
|
m_DeferredDirectMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredDirectMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredDirectMaterialMRT, tileKeywords, 0); |
|
|
|
m_DeferredDirectMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredDirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredDirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero); |
|
|
|
|
|
|
|
m_DeferredIndirectMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredIndirectMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredIndirectMaterialSRT, tileKeywords, 1); |
|
|
|
m_DeferredIndirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredIndirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredIndirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source
|
|
|
|
|
|
|
|
m_DeferredIndirectMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredIndirectMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredIndirectMaterialMRT, tileKeywords, 1); |
|
|
|
m_DeferredIndirectMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredIndirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredIndirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source
|
|
|
|
|
|
|
|
m_DeferredAllMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredAllMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredAllMaterialSRT, tileKeywords, 2); |
|
|
|
m_DeferredAllMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredAllMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredAllMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero); |
|
|
|
|
|
|
|
m_DeferredAllMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_DeferredAllMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
Utilities.SelectKeyword(m_DeferredAllMaterialMRT, tileKeywords, 2); |
|
|
|
m_DeferredAllMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS"); |
|
|
|
m_DeferredAllMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
|
|
|
m_DeferredAllMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero); |
|
|
|
|
|
|
|
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewTiles"); |
|
|
|
|
|
|
|
m_SingleDeferredMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_SingleDeferredMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
m_SingleDeferredMaterialSRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS"); |
|
|
|
m_SingleDeferredMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS); |
|
|
|
|
|
|
|
|
|
|
m_SingleDeferredMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred"); |
|
|
|
m_SingleDeferredMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader); |
|
|
|
m_SingleDeferredMaterialMRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS"); |
|
|
|
m_SingleDeferredMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING"); |
|
|
|
m_SingleDeferredMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS); |
|
|
|
|
|
|
|
|
|
|
m_DebugDisplayShadowMap = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugDisplayShadowMap"); |
|
|
|
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial(m_Resources.debugViewTilesShader); |
|
|
|
m_DebugDisplayShadowMap = Utilities.CreateEngineMaterial(m_Resources.debugDisplayShadowMapShader); |
|
|
|
|
|
|
|
m_DefaultTexture2DArray = new Texture2DArray(1, 1, 1, TextureFormat.ARGB32, false); |
|
|
|
m_DefaultTexture2DArray.SetPixels32(new Color32[1] { new Color32(128, 128, 128, 128) }, 0); |
|
|
|