浏览代码

Merge remote-tracking branch 'refs/remotes/origin/master' into Add-physical-Light-unit-2

/main
sebastienlagarde 7 年前
当前提交
baa79a02
共有 5 个文件被更改,包括 70 次插入7 次删除
  1. 19
      ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs
  3. 39
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs
  4. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs
  5. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs

19
ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs


public VectorArray<ShadowPayload> payloads { get { return m_Payloads; } set { m_Payloads = value; } }
}
public struct ShadowBudgets
{
public int maxPointLights;
public int maxSpotLights;
public int maxDirectionalLights;
}
private const int k_MaxShadowmapPerType = 4;
private ShadowSettings m_ShadowSettings;
private ShadowmapBase[] m_Shadowmaps;

// and register itself
AdditionalShadowDataEditor.SetRegistry( this );
#endif
}
public ShadowManager(ShadowSettings shadowSettings, ref ShadowContext.CtxtInit ctxtInitializer, ref ShadowBudgets budgets, ShadowmapBase[] shadowmaps ) : this( shadowSettings, ref ctxtInitializer, shadowmaps )
{
SetPerFrameBudgets( ref budgets );
}
public void SetPerFrameBudgets( ref ShadowBudgets budgets )
{
m_MaxShadows[(int)GPUShadowType.Point ,0] = m_MaxShadows[(int)GPUShadowType.Point ,1] = budgets.maxPointLights;
m_MaxShadows[(int)GPUShadowType.Spot ,0] = m_MaxShadows[(int)GPUShadowType.Spot ,1] = budgets.maxSpotLights;
m_MaxShadows[(int)GPUShadowType.Directional,0] = m_MaxShadows[(int)GPUShadowType.Directional ,1] = budgets.maxDirectionalLights;
}
public override void UpdateCullingParameters( ref ScriptableCullingParameters cullingParams )

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs


[Tooltip("Layer Mask used for the volume interpolation for this camera.")]
public LayerMask volumeLayerMask = -1;
// Physical parameters
public float aperture = 8f;
public float shutterSpeed = 1f / 200f;
public float iso = 400f;
// To be able to turn on/off FrameSettings properties at runtime for debugging purpose without affecting the original one
// we create a runtime copy (m_ActiveFrameSettings that is used, and any parametrization is done on serialized frameSettings)
[SerializeField]

39
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs


Inspector = new []
{
SectionPrimarySettings,
SectionPhysicalSettings,
SectionCaptureSettings,
SectionOutputSettings,
SectionXRSettings,

CED.Action(Drawer_FieldRenderingPath),
CED.space
);
public static readonly CED.IDrawer SectionPhysicalSettings = CED.FoldoutGroup(
"Physical Settings",
(s, p, o) => s.isSectionExpandedPhysicalSettings,
FoldoutOption.Indent,
CED.Action(Drawer_FieldAperture),
CED.Action(Drawer_FieldShutterSpeed),
CED.Action(Drawer_FieldIso));
public static readonly CED.IDrawer SectionCaptureSettings = CED.FoldoutGroup(
"Capture Settings",

SerializedHDCamera m_SerializedHdCamera;
public AnimBool isSectionExpandedOrthoOptions { get { return m_AnimBools[0]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedOutputSettings { get { return m_AnimBools[2]; } }
public AnimBool isSectionAvailableRenderLoopSettings { get { return m_AnimBools[3]; } }
public AnimBool isSectionExpandedXRSettings { get { return m_AnimBools[4]; } }
public AnimBool isSectionAvailableXRSettings { get { return m_AnimBools[5]; } }
public AnimBool isSectionExpandedPhysicalSettings { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[2]; } }
public AnimBool isSectionExpandedOutputSettings { get { return m_AnimBools[3]; } }
public AnimBool isSectionAvailableRenderLoopSettings { get { return m_AnimBools[4]; } }
public AnimBool isSectionExpandedXRSettings { get { return m_AnimBools[5]; } }
public AnimBool isSectionAvailableXRSettings { get { return m_AnimBools[6]; } }
public bool canOverrideRenderLoopSettings { get; set; }

: base(6)
: base(7)
{
canOverrideRenderLoopSettings = false;
}

"Clipping Planes",
new[] { p.nearClippingPlane, p.farClippingPlane },
new[] { _.GetContent("Near|The closest point relative to the camera that drawing will occur."), _.GetContent("Far|The furthest point relative to the camera that drawing will occur.\n") });
}
static void Drawer_FieldAperture(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.aperture, _.GetContent("Aperture"));
}
static void Drawer_FieldShutterSpeed(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
EditorGUILayout.PropertyField(p.shutterSpeed, _.GetContent("Shutter Speed (1 / x)"));
p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
}
static void Drawer_FieldIso(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.iso, _.GetContent("ISO"));
}
static void Drawer_FieldNormalizedViewPort(HDCameraUI s, SerializedHDCamera p, Editor owner)

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs


public SerializedProperty farClippingPlane;
public SerializedProperty targetEye;
public SerializedProperty aperture;
public SerializedProperty shutterSpeed;
public SerializedProperty iso;
#if ENABLE_MULTIPLE_DISPLAYS
public SerializedProperty targetDisplay;
#endif

targetEye = serializedObject.FindProperty("m_TargetEye");
aperture = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.aperture);
shutterSpeed = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.shutterSpeed);
iso = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.iso);
clearColorMode = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearColorMode);
backgroundColorHDR = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.backgroundColorHDR);

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


scInit.dataSyncer = syncer;
scInit.resourceBinder = binder;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
ShadowManager.ShadowBudgets budgets;
budgets.maxPointLights = 6;
budgets.maxSpotLights = 12;
budgets.maxDirectionalLights = 1;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, ref budgets, m_Shadowmaps);
// set global overrides - these need to match the override specified in LightLoop/Shadow.hlsl
bool useGlobalOverrides = true;
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V2, ShadowPrecision.High, useGlobalOverrides );

正在加载...
取消
保存