浏览代码

Correction for area light not working with LightType.Area

/main
sebastienlagarde 7 年前
当前提交
87949b64
共有 2 个文件被更改,包括 15 次插入12 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/AdditionalData/HDAdditionalLightData.cs
  2. 25
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Editor/HDLightEditor.cs

2
ScriptableRenderPipeline/HDRenderPipeline/AdditionalData/HDAdditionalLightData.cs


private void OnDrawGizmos()
{
DrawGizmos(false);
// DrawGizmos(false);
}
private void OnDrawGizmosSelected()

25
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Editor/HDLightEditor.cs


// This enum below is LightType enum + LightTypeExtent enum
public enum LightShape
{
Spot = 0,
Directional = 1,
Point = 2,
//Area = 3, <= offline type of Unity not dispay in our case but reuse for GI of our area light
Rectangle = 4,
Line = 5,
// Sphere = 6,
// Disc = 7,
Spot,
Directional,
Point,
//Area, <= offline type of Unity not dispay in our case but reuse for GI of our area light
Rectangle,
Line,
// Sphere,
// Disc,
}
// LightShape is use for displaying UI only. The processing code must use LightTypeExtent and LightType

break;
case LightShape.Rectangle:
m_Type.enumValueIndex = (int)LightType.Area;
// TODO: Currently if we use Area type as it is offline light in legacy, the light will not exist at runtime
//m_Type.enumValueIndex = (int)LightType.Area;
m_Type.enumValueIndex = (int)LightType.Point;
m_LightTypeExtent.enumValueIndex = (int)LightTypeExtent.Rectangle;
EditorGUILayout.PropertyField(m_ShapeLength);
EditorGUILayout.PropertyField(m_ShapeWidth);

break;
case LightShape.Line:
m_Type.enumValueIndex = (int)LightType.Area;
// TODO: Currently if we use Area type as it is offline light in legacy, the light will not exist at runtime
//m_Type.enumValueIndex = (int)LightType.Area;
m_Type.enumValueIndex = (int)LightType.Point;
m_ShapeWidth.floatValue = 0;
// Fake line with a small rectangle in vanilla unity for GI
m_AreaSizeX.floatValue = m_ShapeLength.floatValue;
m_AreaSizeY.floatValue = 0.01f;

正在加载...
取消
保存