浏览代码

Update tooltip for users for ligths

/2018.1
sebastienlagarde 6 年前
当前提交
9c6a5b99
共有 2 个文件被更改,包括 27 次插入12 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
  2. 33
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs


public readonly GUIContent indirectBounceShadowWarning = new GUIContent("Realtime indirect bounce shadowing is not supported for Spot and Point lights.");
// Additional light data
public readonly GUIContent directionalIntensity = new GUIContent("Intensity (Lux)", "");
public readonly GUIContent punctualIntensity = new GUIContent("Intensity (Lumen)", "");
public readonly GUIContent areaIntensity = new GUIContent("Intensity (Lumen)", "");
public readonly GUIContent directionalIntensity = new GUIContent("Intensity (Lux)", "Illuminance of the directional light at ground level in lux.");
public readonly GUIContent punctualIntensity = new GUIContent("Intensity (Lumen)", "Luminous power of the light in lumen. Spotlight are considered as point light with barndoor so match intensity of a point light.");
public readonly GUIContent areaIntensity = new GUIContent("Intensity (Lumen)", "Luminous power of the light in lumen.");
public readonly GUIContent maxSmoothness = new GUIContent("Max Smoothness", "Very low cost way of faking spherical area lighting. This will modify the roughness of the material lit. This is useful when the specular highlight is too small or too sharp.");
public readonly GUIContent affectDiffuse = new GUIContent("Affect Diffuse", "This will disable diffuse lighting for this light. Doesn't save performance, diffuse lighting is still computed.");

33
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs


// Physical light unit helper
// All light unit are in lumen (Luminous power)
// Punctual light (point, spot) are convert to candela (cd = lumens / steradian)
// Area light are convert to luminance (cd/(m^2*steradian)) with the following formulation: Luminous Power / (Area * PI * steradian)
// For our isotropic area lights which expect radiance(W / (sr* m^2)) in the shader:
// power = Integral{area, Integral{hemisphere, radiance * <N, L>}},
// power = area * Pi * radiance,
// radiance = power / (area * Pi).
// We use photometric unit, so radiance is luminance and power is luminous power
// Ref: Moving Frostbite to PBR
// Also good ref: https://www.radiance-online.org/community/workshops/2004-fribourg/presentations/Wandachowicz_paper.pdf

// convert intensity (lumen) to nits
public static float CalculateLineLightIntensity(float intensity, float lineWidth)
{
// Line lights in the shader expect intensity (W / sr).
// In the UI, we specify luminous flux(power) in lumens.
// First, it needs to be converted to radiometric units(radiant flux, W).
// Then we must recall how to compute power from intensity for a line light:
// power = Integral{length, Integral{sphere, intensity}}.
// For an isotropic line light, intensity is constant, so
// power = length * (4 * Pi) * intensity,
// intensity = power / (length * (4 * Pi)).
//Line lights expect radiance (W / (sr * m^2)) in the shader.
//In the UI, we specify luminous flux (power) in lumens.
//First, it needs to be converted to radiometric units (radiant flux, W).
//Then we must recall how to compute power from radiance:
//radiance = differential_power / (differrential_projected_area * differential_solid_angle),
//radiance = differential_power / (differrential_area * differential_solid_angle * <N, L>),
//power = Integral{area, Integral{hemisphere, radiance * <N, L>}}.
//Unlike tube lights, our line lights have no surface area, so the integral becomes:
//power = Integral{length, Integral{sphere, radiance}}.
//For an isotropic line light, radiance is constant, therefore:
//power = length * (4 * Pi) * radiance,
//radiance = power / (length * (4 * Pi)).
return intensity / (4.0f * Mathf.PI * lineWidth);
}
}
正在加载...
取消
保存