浏览代码

Merge pull request #485 from Unity-Technologies/msvo

Added multi-scale volumetric obscurance support (from postfx v2)
/stochastic_alpha_test
GitHub 7 年前
当前提交
32bdbbfa
共有 3 个文件被更改,包括 35 次插入6 次删除
  1. 32
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 1
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusion.cs
  3. 8
      TestbedPipelines/Fptl/FptlLighting.cs

32
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


using (new ProfilingSample(cmd, "Build Light list and render shadows"))
{
// TODO: Everything here (SSAO, Shadow, Build light list, deffered shadow, material and light classification can be parallelize with Async compute)
m_SsaoEffect.Render(ssaoSettingsToUse, this, hdCamera, renderContext, cmd, m_Asset.renderingSettings.useForwardRenderingOnly);
if (ssaoSettingsToUse.enable)
{
// Override v2's MSVO if the internal default one is enabled
m_SsaoEffect.Render(ssaoSettingsToUse, this, hdCamera, renderContext, cmd, m_Asset.renderingSettings.useForwardRenderingOnly);
}
else if (postProcessLayer != null)
{
var settings = postProcessLayer.GetSettings<AmbientOcclusion>();
if (settings.IsEnabledAndSupported(null))
{
cmd.GetTemporaryRT(HDShaderIDs._AmbientOcclusionTexture, new RenderTextureDescriptor(camera.pixelWidth, camera.pixelHeight, RenderTextureFormat.R8, 0)
{
sRGB = false,
enableRandomWrite = true
}, FilterMode.Bilinear);
postProcessLayer.BakeMSVOMap(cmd, camera, HDShaderIDs._AmbientOcclusionTexture, GetDepthTexture(), true);
cmd.SetGlobalFloat(HDShaderIDs._AmbientOcclusionDirectLightStrenght, settings.directLightingStrength.value);
PushFullScreenDebugTexture(cmd, HDShaderIDs._AmbientOcclusionTexture, camera, renderContext, FullScreenDebugMode.SSAO);
// AO color is available at:
// settings.color.value
}
else
{
cmd.SetGlobalTexture(HDShaderIDs._AmbientOcclusionTexture, RuntimeUtilities.blackTexture); // Neutral is black, see the comment in the shaders
cmd.SetGlobalFloat(HDShaderIDs._AmbientOcclusionDirectLightStrenght, 0f);
}
}
m_LightLoop.PrepareLightsForGPU(m_ShadowSettings, m_CullResults, camera);
m_LightLoop.RenderShadows(renderContext, cmd, m_CullResults);

1
ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusion.cs


using UnityEngine;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering.HDPipeline

8
TestbedPipelines/Fptl/FptlLighting.cs


}
else
{
#pragma warning disable CS0162
#pragma warning disable 0162
#pragma warning restore CS0162
#pragma warning restore 0162
}
CommandBuffer cmdShadow = CommandBufferPool.Get();

}
else
{
#pragma warning disable CS0162
#pragma warning disable 0162
#pragma warning restore CS0162
#pragma warning restore 0162
}
// do deferred lighting

正在加载...
取消
保存