浏览代码

Merge pull request #1140 from Unity-Technologies/fix-fogbugz-989321

fix fogbugz 989321 - Light broken when created as "Area" light
/main
GitHub 7 年前
当前提交
72eb8fea
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Light/HDAdditionalLightData.cs

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Light/HDAdditionalLightData.cs


// As we have our own default value, we need to initialize the light intensity correctly
public static void InitDefaultHDAdditionalLightData(HDAdditionalLightData lightData)
{
// At first init we need to initialize correctly the default value
lightData.ConvertPhysicalLightIntensityToLightIntensity();
// Special treatment for Unity builtin area light. Change it to our rectangle light
// Special treatment for Unity built-in area light. Change it to our rectangle light
var light = lightData.gameObject.GetComponent<Light>();
// Sanity check: lightData.lightTypeExtent is init to LightTypeExtent.Punctual (in case for unknow reasons we recreate additional data on an existing line)

light.type = LightType.Point; // Same as in HDLightEditor
light.lightmapBakeType = LightmapBakeType.Realtime;
// At first init we need to initialize correctly the default value
lightData.ConvertPhysicalLightIntensityToLightIntensity();
}
}
正在加载...
取消
保存