浏览代码

Merge fixes

/main
Frédéric Vauchelles 7 年前
当前提交
cf68f546
共有 3 个文件被更改,包括 25 次插入19 次删除
  1. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDCubemapInspector.cs
  2. 42
      com.unity.render-pipelines.high-definition/HDRP/HDRenderPipeline.cs

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDCubemapInspector.cs


void InitPreview()
{
if (m_PreviewUtility != null)
m_PreviewUtility.Cleanup();
m_PreviewUtility = new PreviewRenderUtility(false, true);
m_PreviewUtility.cameraFieldOfView = 50.0f;
m_PreviewUtility.camera.nearClipPlane = 0.01f;

42
com.unity.render-pipelines.high-definition/HDRP/HDRenderPipeline.cs


cmd.SetGlobalVector(HDShaderIDs._ColorPyramidSize, Vector4.one);
cmd.SetGlobalVector(HDShaderIDs._ColorPyramidScale, Vector4.one);
}
cmd.SetGlobalBuffer(HDShaderIDs._DebugScreenSpaceTracingData, m_DebugScreenSpaceTracingData);
}
}

renderContext.SetupCameraProperties(camera, hdCamera.frameSettings.enableStereo);
PushGlobalParams(hdCamera, cmd, diffusionProfileSettings);
PushVelocityBuffer(hdCamera, renderContext, cmd);
// TODO: Find a correct place to bind these material textures
// We have to bind the material specific global parameters in this mode

RenderDepthPyramid(hdCamera, cmd, renderContext, FullScreenDebugMode.DepthPyramid);
RenderCameraVelocity(m_CullResults, hdCamera, renderContext, cmd);
PushVelocityBuffer(hdCamera, renderContext, cmd);
// Depth texture is now ready, bind it (Depth buffer could have been bind before if DBuffer is enable)
cmd.SetGlobalTexture(HDShaderIDs._CameraDepthTexture, GetDepthTexture());

: m_ForwardOnlyPassNames;
var debugSSTThisPass = debugScreenSpaceTracing && (m_CurrentDebugDisplaySettings.lightingDebugSettings.debugLightingMode == DebugLightingMode.ScreenSpaceTracingReflection);
if (debugSSTThisPass)
{
cmd.SetGlobalBuffer(HDShaderIDs._DebugScreenSpaceTracingData, m_DebugScreenSpaceTracingData);
}
RenderOpaqueRenderList(cullResults, hdCamera, renderContext, cmd, passNames, m_currentRendererConfigurationBakedLighting);
if (debugSSTThisPass)
cmd.ClearRandomWriteTargets();

var debugSSTThisPass = debugScreenSpaceTracing && (m_CurrentDebugDisplaySettings.lightingDebugSettings.debugLightingMode == DebugLightingMode.ScreenSpaceTracingRefraction);
if (debugSSTThisPass)
{
cmd.SetGlobalBuffer(HDShaderIDs._DebugScreenSpaceTracingData, m_DebugScreenSpaceTracingData);
}
RenderTransparentRenderList(cullResults, hdCamera, renderContext, cmd, m_AllTransparentPassNames, m_currentRendererConfigurationBakedLighting, pass == ForwardPass.PreRefraction ? HDRenderQueue.k_RenderQueue_PreRefraction : HDRenderQueue.k_RenderQueue_Transparent);
if (debugSSTThisPass)
cmd.ClearRandomWriteTargets();

HDUtils.SetRenderTarget(cmd, hdCamera, m_VelocityBuffer, m_CameraDepthStencilBuffer);
RenderOpaqueRenderList(cullResults, hdCamera, renderContext, cmd, HDShaderPassNames.s_MotionVectorsName, RendererConfiguration.PerObjectMotionVectors);
cmd.SetGlobalTexture(HDShaderIDs._CameraMotionVectorsTexture, m_VelocityBuffer);
cmd.SetGlobalVector(HDShaderIDs._CameraMotionVectorsSize, new Vector4(
m_VelocityBuffer.referenceSize.x,
m_VelocityBuffer.referenceSize.y,
1f / m_VelocityBuffer.referenceSize.x,
1f / m_VelocityBuffer.referenceSize.y
));
cmd.SetGlobalVector(HDShaderIDs._CameraMotionVectorsScale, new Vector4(
m_VelocityBuffer.referenceSize.x / (float)m_VelocityBuffer.rt.width,
m_VelocityBuffer.referenceSize.y / (float)m_VelocityBuffer.rt.height,
1, 0.0f
));
}
}

{
// TODO: Be sure that if there is no change in the state of this keyword, it doesn't imply any work on CPU side! else we will need to save the sate somewher
cmd.DisableShaderKeyword("DEBUG_DISPLAY");
}
}
void PushVelocityBuffer(HDCamera hdCamera, ScriptableRenderContext renderContext, CommandBuffer cmd)
{
using (new ProfilingSample(cmd, "Push Velocity Buffer", CustomSamplerId.PushVelocityBufferParameters.GetSampler()))
{
cmd.SetGlobalTexture(HDShaderIDs._CameraMotionVectorsTexture, m_VelocityBuffer);
cmd.SetGlobalVector(HDShaderIDs._CameraMotionVectorsSize, new Vector4(
m_VelocityBuffer.referenceSize.x,
m_VelocityBuffer.referenceSize.y,
1f / m_VelocityBuffer.referenceSize.x,
1f / m_VelocityBuffer.referenceSize.y
));
cmd.SetGlobalVector(HDShaderIDs._CameraMotionVectorsScale, new Vector4(
m_VelocityBuffer.referenceSize.x / (float)m_VelocityBuffer.rt.width,
m_VelocityBuffer.referenceSize.y / (float)m_VelocityBuffer.rt.height,
1, 0.0f
));
}
}

正在加载...
取消
保存