浏览代码

HDRenderPipeline: Remove AO settings from lightloop

/Branch_Batching2
sebastienlagarde 7 年前
当前提交
fc60f6b5
共有 4 个文件被更改,包括 20 次插入19 次删除
  1. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/AmbientOcclusion.cs
  3. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  4. 14
      Assets/DebugMenuState.asset

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


if (debugDisplaySettings.renderingDebugSettings.enableSSS)
{
// Output split lighting for materials tagged with the SSS stencil bit.
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, debugDisplaySettings, m_Asset.ssaoSettingsToUse, colorRTs, m_CameraDepthStencilBufferRT, new RenderTargetIdentifier(GetDepthTexture()), true);
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, debugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, new RenderTargetIdentifier(GetDepthTexture()), true);
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, debugDisplaySettings, m_Asset.ssaoSettingsToUse, colorRTs, m_CameraDepthStencilBufferRT, new RenderTargetIdentifier(GetDepthTexture()), false);
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, debugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, new RenderTargetIdentifier(GetDepthTexture()), false);
}
// Combines specular lighting and diffuse lighting with subsurface scattering.

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/AmbientOcclusion.cs


const FilterMode kFilter = FilterMode.Bilinear;
// Note: Currently there is no SSAO in forward as we don't have normal buffer
// If SSAO is disable, simply put a white 1x1 texture
var cmd2 = new CommandBuffer { name = "Ambient Occlusion (1x1)" };
// TODO: Create a white 1x1 texture to setup here when AO is disabled (we could also do a variant in shader, but this increase number of combination)
cmd2.GetTemporaryRT(Uniforms._AOBuffer, 1, 1, 0, kFilter, kFormat, kRWMode);
cmd2.SetRenderTarget(Uniforms._AOBuffer);
cmd2.ClearRenderTarget(false, true, Color.white);
// Setup texture for lighting pass (automatic of unity)
cmd2.SetGlobalTexture("_AmbientOcclusionTexture", Uniforms._AOBuffer);
// Register the command buffer and release it.
var cmd2 = new CommandBuffer { name = "Setup neutral Ambient Occlusion (1x1)" };
cmd2.SetGlobalTexture("_AmbientOcclusionTexture", PostProcessing.RuntimeUtilities.whiteTexture);
renderContext.ExecuteCommandBuffer(cmd2);
cmd2.Dispose();

public void Cleanup()
{
if (m_Material != null)
{
if (Application.isPlaying)
Object.Destroy(m_Material);
else
Object.DestroyImmediate(m_Material);
}
Utilities.Destroy(m_Material);
}
}
}

1
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


public void RenderDeferredLighting( HDCamera hdCamera, ScriptableRenderContext renderContext,
DebugDisplaySettings debugDisplaySettings,
ScreenSpaceAmbientOcclusionSettings.Settings ambientOcclusionSettings,
RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthStencilBuffer, RenderTargetIdentifier depthStencilTexture,
bool outputSplitLightingForSSS)
{

14
Assets/DebugMenuState.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d17031e345b144b4a887f66665be6a2b, type: 3}
m_Name: DebugMenuState
m_EditorClassIdentifier:
m_ItemStateList: []
正在加载...
取消
保存