浏览代码

Move Shader.globalRenderPipeline = "HDRenderPipeline" at a better place

/main
sebastienlagarde 7 年前
当前提交
5ca9a48a
共有 1 个文件被更改,包括 13 次插入7 次删除
  1. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

20
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


// 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();

正在加载...
取消
保存