|
|
|
|
|
|
// Initialize various compute shader resources
|
|
|
|
m_applyDistortionKernel = m_applyDistortionCS.FindKernel("KMain"); |
|
|
|
|
|
|
|
// Set subshader pipeline tag
|
|
|
|
Shader.globalRenderPipeline = "HDRenderPipeline"; |
|
|
|
|
|
|
|
// General material
|
|
|
|
m_CopyStencilForNoLighting = CoreUtils.CreateEngineMaterial(asset.renderPipelineResources.copyStencilBuffer); |
|
|
|
m_CopyStencilForNoLighting.SetInt(HDShaderIDs._StencilRef, (int)StencilLightingUsage.NoLighting); |
|
|
|
|
|
|
m_CopyDepth = CoreUtils.CreateEngineMaterial(asset.renderPipelineResources.copyDepthBuffer); |
|
|
|
|
|
|
|
InitializeDebugMaterials(); |
|
|
|
|
|
|
|
|
|
|
|
m_MaterialList.ForEach(material => material.Build(asset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetRenderingFeatures() |
|
|
|
{ |
|
|
|
// Set subshader pipeline tag
|
|
|
|
Shader.globalRenderPipeline = "HDRenderPipeline"; |
|
|
|
|
|
|
|
// HD use specific GraphicsSettings
|
|
|
|
GraphicsSettings.lightsUseLinearIntensity = true; |
|
|
|
GraphicsSettings.lightsUseColorTemperature = true; |
|
|
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
void UnsetRenderingFeatures() |
|
|
|
{ |
|
|
|
Shader.globalRenderPipeline = ""; |
|
|
|
|
|
|
|
SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); |
|
|
|
|
|
|
|
Lightmapping.ResetDelegate(); |
|
|
|
} |
|
|
|
|
|
|
|
void InitializeDebugMaterials() |
|
|
|
{ |
|
|
|
m_DebugViewMaterialGBuffer = CoreUtils.CreateEngineMaterial(m_Asset.renderPipelineResources.debugViewMaterialGBufferShader); |
|
|
|
|
|
|
|
|
|
|
DestroyRenderTextures(); |
|
|
|
|
|
|
|
SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); |
|
|
|
|
|
|
|
Lightmapping.ResetDelegate(); |
|
|
|
UnsetRenderingFeatures(); |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
SceneViewDrawMode.ResetDrawMode(); |
|
|
|