浏览代码

Calculate correct intensity for the light

/main
sebastienlagarde 8 年前
当前提交
4644098b
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs

9
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


l.positionWS = light.light.transform.position;
l.invSqrAttenuationRadius = 1.0f / (light.range * light.range);
l.color = new Vec3(light.finalColor.r, light.finalColor.g, light.finalColor.b);
// Correct intensity calculation (Different from Unity)
float lightColorR = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.r);
float lightColorG = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.g);
float lightColorB = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.b);
l.color = new Vec3(lightColorR, lightColorG, lightColorB);
// Light direction is opposite to the forward direction...
l.forward = -light.light.transform.forward;
// CAUTION: For IES as we inverse forward maybe this will need rotation.

正在加载...
取消
保存