浏览代码

Merge pull request #48 from Unity-Technologies/Enable-CCT-and-linear-lighting

HDRenderLoop: Enable CCT and LinearLighting
/main
GitHub 8 年前
当前提交
731fd93e
共有 2 个文件被更改,包括 4 次插入10 次删除
  1. 7
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 7
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.cs

7
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


reflectionProbe = UnityEditor.SupportedRenderingFeatures.ReflectionProbe.Rotation
};
#endif
/*
*/
m_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture");
m_CameraDepthBuffer = Shader.PropertyToID("_CameraDepthTexture");

#if UNITY_EDITOR
UnityEditor.SupportedRenderingFeatures.active = UnityEditor.SupportedRenderingFeatures.Default;
#endif
// UnityEngine.Rendering.GraphicsSettings.lightsUseLinearIntensity = previousLightsUseLinearIntensity;
// UnityEngine.Rendering.GraphicsSettings.lightsUseCCT = previousLightsUseCCT;
UnityEngine.Rendering.GraphicsSettings.lightsUseLinearIntensity = previousLightsUseLinearIntensity;
UnityEngine.Rendering.GraphicsSettings.lightsUseCCT = previousLightsUseCCT;
}
void InitAndClearBuffer(Camera camera, RenderLoop renderLoop)

7
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.cs


public Vector3 GetLightColor(VisibleLight light)
{
// Linear intensity calculation (different from legacy Unity - match LinearLighting new option in 5.6)
var lightColorR = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.r);
var lightColorG = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.g);
var lightColorB = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.b);
return new Vector3(lightColorR, lightColorG, lightColorB);
return new Vector3(light.finalColor.r, light.finalColor.g, light.finalColor.b);
}
// Return number of added shadow

正在加载...
取消
保存