|
|
|
|
|
|
public CommonSettings.Settings commonSettingsToUse |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (CommonSettingsSingleton.overrideSettings) |
|
|
|
return CommonSettingsSingleton.overrideSettings.settings; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Debugging
|
|
|
|
public GlobalDebugParameters globalDebugParameters = new GlobalDebugParameters(); |
|
|
|
readonly DebugParameters m_DebugParameters = new DebugParameters(); |
|
|
|
readonly DebugParameters m_DebugParameters = new DebugParameters(); |
|
|
|
|
|
|
|
public DebugParameters debugParameters |
|
|
|
{ |
|
|
|
|
|
|
m_SssParameters.profiles[0].lerpWeight = commonSettings.sssProfileLerpWeight; |
|
|
|
m_SssParameters.bilateralScale = commonSettings.sssBilateralScale; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public struct HDCamera |
|
|
|
{ |
|
|
|
public Camera camera; |
|
|
|
public Vector4 screenSize; |
|
|
|
public Matrix4x4 viewProjectionMatrix; |
|
|
|
public Matrix4x4 invViewProjectionMatrix; |
|
|
|
public struct HDCamera |
|
|
|
{ |
|
|
|
public Camera camera; |
|
|
|
public Vector4 screenSize; |
|
|
|
public Matrix4x4 viewProjectionMatrix; |
|
|
|
public Matrix4x4 invViewProjectionMatrix; |
|
|
|
} |
|
|
|
|
|
|
|
public class GBufferManager |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public class HDRenderPipelineInstance : RenderPipeline |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly HDRenderPipeline m_Owner; |
|
|
|
|
|
|
|
// TODO: Find a way to automatically create/iterate through deferred material
|
|
|
|
|
|
|
{ |
|
|
|
m_Owner = owner; |
|
|
|
|
|
|
|
m_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture"); |
|
|
|
m_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture"); |
|
|
|
m_CameraColorBufferRT = new RenderTargetIdentifier(m_CameraColorBuffer); |
|
|
|
m_CameraColorBufferRT = new RenderTargetIdentifier(m_CameraColorBuffer); |
|
|
|
m_CameraSubsurfaceBufferRT = new RenderTargetIdentifier(m_CameraSubsurfaceBuffer); |
|
|
|
m_CameraFilteringBufferRT = new RenderTargetIdentifier(m_CameraFilteringBuffer); |
|
|
|
m_CameraDepthStencilBufferRT = new RenderTargetIdentifier(m_CameraDepthStencilBuffer); |
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
if (camera.pixelWidth != m_CurrentWidth || camera.pixelHeight != m_CurrentHeight || m_LightLoop.NeedResize()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (m_CurrentWidth > 0 && m_CurrentHeight > 0) |
|
|
|
{ |
|
|
|
m_LightLoop.ReleaseResolutionDependentBuffers(); |
|
|
|
|
|
|
Shader.SetGlobalInt("_EnvLightSkyEnabled", 1); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var cmd = new CommandBuffer {name = "Push Global Parameters"}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderContext.ExecuteCommandBuffer(cmd); |
|
|
|
cmd.Dispose(); |
|
|
|
renderContext.ExecuteCommandBuffer(cmd); |
|
|
|
cmd.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras) |
|
|
|
{ |
|
|
|
|
|
|
// 'm_CameraStencilBufferRT' is a temporary copy of the stencil buffer and should be removed
|
|
|
|
// once we are able to read from the depth buffer and perform the stencil test simultaneously.
|
|
|
|
using (new Utilities.ProfilingSample("Copy depth-stencil buffer", renderContext)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
using (new Utilities.ProfilingSample("Shadow Pass", renderContext)) |
|
|
|
{ |
|
|
|
m_ShadowPass.Render(renderContext, cullResults, out m_ShadowsResult); |
|
|
|
|
|
|
RenderDistortion(cullResults, camera, renderContext); |
|
|
|
|
|
|
|
FinalPass(camera, renderContext); |
|
|
|
} |
|
|
|
|
|
|
|
RenderDebugOverlay(camera, renderContext); |
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
m_SkyManager.RenderSky(hdCamera, m_LightLoop == null ? null : m_LightLoop.GetCurrentSunLight(), m_CameraColorBufferRT, m_CameraDepthStencilBufferRT, renderContext); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RenderForward(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, bool renderOpaque) |
|
|
|
{ |
|
|
|
// TODO: Currently we can't render opaque object forward when deferred is enabled
|
|
|
|