浏览代码

Merge pull request #1100 from Unity-Technologies/Branch_VariousFixes

Various bug fixes
/main
GitHub 6 年前
当前提交
992a18a3
共有 7 个文件被更改,包括 22 次插入11 次删除
  1. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs
  3. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Shadows/HDShadowSettingsEditor.cs
  4. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  5. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
  6. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.hlsl
  7. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Shadows/HDShadowSettings.cs

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs


// If TAA is enabled projMatrix will hold a jittered projection matrix. The original,
// non-jittered projection matrix can be accessed via nonJitteredProjMatrix.
bool taaEnabled = camera.cameraType == CameraType.Game &&
CoreUtils.IsTemporalAntialiasingActive(postProcessLayer);
CoreUtils.IsTemporalAntialiasingActive(postProcessLayer) &&
frameSettings.enablePostprocess;
var nonJitteredCameraProj = camera.projectionMatrix;
var cameraProj = taaEnabled

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs


UnregisterDebugItems(k_PanelDisplayStats, m_DebugDisplayStatsItems);
UnregisterDebugItems(k_PanelMaterials, m_DebugMaterialItems);
UnregisterDebugItems(k_PanelLighting, m_DebugLightingItems);
UnregisterDebugItems(k_PanelRendering, m_DebugLightingItems);
UnregisterDebugItems(k_PanelRendering, m_DebugRenderingItems);
}
void UnregisterDebugItems(string panelName, DebugUI.Widget[] items)

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Shadows/HDShadowSettingsEditor.cs


SerializedDataParameter[] m_CascadeShadowSplits = new SerializedDataParameter[3];
SerializedDataParameter[] m_CascadeShadowBorders = new SerializedDataParameter[4];
// For now we don't use borders so we hide the UI.
bool m_bShowBorders = false;
public override void OnEnable()
{
var o = new PropertyFetcher<HDShadowSettings>(serializedObject);

PropertyField(m_CascadeShadowSplits[i], CoreEditorUtils.GetContent(string.Format("Split {0}", i + 1)));
}
if(m_bShowBorders)
if(LightLoop.s_UseCascadeBorders)
{
EditorGUILayout.Space();

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


}
}
// Disable postprocess if we enable debug mode
if (m_CurrentDebugDisplaySettings.fullScreenDebugMode == FullScreenDebugMode.None && m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled())
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
// Disable post process if we enable debug mode or if the post process layer is disabled
if (m_CurrentDebugDisplaySettings.fullScreenDebugMode != FullScreenDebugMode.None || m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() || !CoreUtils.IsPostProcessingActive(postProcessLayer))
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
var hdCamera = HDCamera.Get(camera, postProcessLayer, m_FrameSettings);
Resize(hdCamera);

StartStereoRendering(renderContext, hdCamera.camera);
// Final blit
if (m_FrameSettings.enablePostprocess && CoreUtils.IsPostProcessingActive(postProcessLayer))
if (m_FrameSettings.enablePostprocess)
{
RenderPostProcess(hdCamera, cmd, postProcessLayer);
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs


TextureCacheCubemap m_CubeCookieTexArray;
List<Matrix4x4> m_Env2DCaptureVP = new List<Matrix4x4>();
// For now we don't use shadow cascade borders.
static public readonly bool s_UseCascadeBorders = true;
public class LightList
{
public List<DirectionalLightData> directionalLights;

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.hlsl


float3(1.0, 1.0, 1.0)
};
diffuseLighting = float3(0.0, 0.0, 0.0);
diffuseLighting = float3(1.0, 1.0, 1.0);
if (_DirectionalLightCount > 0)
{
int shadowIdx = _DirectionalLightDatas[0].shadowIndex;

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Shadows/HDShadowSettings.cs


m_CascadeShadowBorders[1] = cascadeShadowBorder1;
m_CascadeShadowBorders[2] = cascadeShadowBorder2;
m_CascadeShadowBorders[3] = cascadeShadowBorder3;
/* Borders are currently broken if cascade count is not 4. Enable this when it's fixed.
// For now we don't use shadow cascade borders but we still want to have the last split fading out.
if(!LightLoop.s_UseCascadeBorders)
{
m_CascadeShadowBorders[cascadeShadowSplitCount - 1] = 0.2f;
}
*/
return m_CascadeShadowBorders;
}
}

正在加载...
取消
保存