浏览代码

Fix emissive mesh color

/main
sebastienlagarde 6 年前
当前提交
905e4624
共有 2 个文件被更改,包括 8 次插入15 次删除
  1. 2
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  2. 21
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs

2
com.unity.render-pipelines.high-definition/CHANGELOG.md


- Fixed apply range attenuation option on punctual light
- Fixed issue when using more than one volume mask texture with density volumes.
- Fixed an error which prevented volumetric lighting from working if no density volumes with 3D textures were present.
- Fixed issue with color temperature not take correctly into account with static lighting
### Added
- Add option supportDitheringCrossFade on HDRP Asset to allow to remove shader variant during player build if needed

- Add an option to generate an emissive mesh for area lights (currently rectangle light only). The mesh fits the size, intensity and color of the light.
- Add an option to the HDRP asset to increase the resolution of volumetric lighting.
- Add additional ligth unit support for punctual light (Lumens, Candela) and area lights (Lumens, Luminance)
### Changed
- Re-enable shadow mask mode in debug view

21
com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs


m_Light.transform.localScale = lightSize;
m_Light.areaSize = lightSize;
float areaLightIntensity = intensity;
// If the light unit is in lumen, we need a convertion to get the good intensity value
if (lightUnit == LightUnit.Lumen)
{
areaLightIntensity = LightUtils.ConvertRectLightLumenToLuminance(
intensity,
shapeWidth,
shapeHeight);
}
break;
default:
break;

// Update Mesh emissive properties
emissiveMeshRenderer.sharedMaterial.SetColor("_UnlitColor", Color.black);
// Note that we must use the light in linear RGB
// m_Light.intensity is in luminance which is the value we need for emissive color
Color value = m_Light.color.linear * m_Light.intensity;
emissiveMeshRenderer.sharedMaterial.SetColor("_EmissiveColor", m_Light.color.linear * areaLightIntensity * LightUtils.CorrelatedColorTemperatureToRGB(m_Light.colorTemperature));
else
emissiveMeshRenderer.sharedMaterial.SetColor("_EmissiveColor", m_Light.color.linear * areaLightIntensity);
value *= LightUtils.CorrelatedColorTemperatureToRGB(m_Light.colorTemperature);
emissiveMeshRenderer.sharedMaterial.SetColor("_EmissiveColor", value);
}
#endif

正在加载...
取消
保存