浏览代码

Use StereoscopicEye instead of bool in Get*VolumeDataAndBound

This reads better than bools
/main
Robert Srinivasiah 7 年前
当前提交
a42d879e
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs

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


// TODO: we should be able to do this calculation only with LightData without VisibleLight light, but for now pass both
public void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLightType, LightVolumeType lightVolumeType,
VisibleLight light, LightData lightData, Vector3 lightDimensions, Matrix4x4 worldToView,
bool rightEyeTarget = false)
Camera.StereoscopicEye eyeIndex = Camera.StereoscopicEye.Left)
{
// Then Culling side
var range = lightDimensions.z;

Debug.Assert(false, "TODO: encountered an unknown GPULightType.");
}
if (rightEyeTarget == false)
if (eyeIndex == Camera.StereoscopicEye.Left)
{
m_lightList.bounds.Add(bound);
m_lightList.lightVolumes.Add(lightVolumeData);

return true;
}
public void GetEnvLightVolumeDataAndBound(ProbeWrapper probe, LightVolumeType lightVolumeType, Matrix4x4 worldToView, bool rightEyeTarget = false)
public void GetEnvLightVolumeDataAndBound(ProbeWrapper probe, LightVolumeType lightVolumeType, Matrix4x4 worldToView, Camera.StereoscopicEye eyeIndex = Camera.StereoscopicEye.Left)
{
var bound = new SFiniteLightBound();
var lightVolumeData = new LightVolumeData();

}
}
if (rightEyeTarget == false)
if (eyeIndex == Camera.StereoscopicEye.Left)
{
m_lightList.bounds.Add(bound);
m_lightList.lightVolumes.Add(lightVolumeData);

// Then culling side. Must be call in this order as we pass the created Light data to the function
GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], lightDimensions, worldToView);
if (stereoEnabled)
GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], lightDimensions, rightEyeWorldToView, true);
GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], lightDimensions, rightEyeWorldToView, Camera.StereoscopicEye.Right);
// We make the light position camera-relative as late as possible in order
// to allow the preceding code to work with the absolute world space coordinates.

{
GetEnvLightVolumeDataAndBound(probeWrapper, lightVolumeType, worldToView);
if (stereoEnabled)
GetEnvLightVolumeDataAndBound(probeWrapper, lightVolumeType, rightEyeWorldToView, true);
GetEnvLightVolumeDataAndBound(probeWrapper, lightVolumeType, rightEyeWorldToView, Camera.StereoscopicEye.Right);
// We make the light position camera-relative as late as possible in order
// to allow the preceding code to work with the absolute world space coordinates.

正在加载...
取消
保存