浏览代码

Use real

/main
Evgenii Golubev 7 年前
当前提交
87df0278
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 12
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonLighting.hlsl

12
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonLighting.hlsl


//-----------------------------------------------------------------------------
// Ref: Moving Frostbite to PBR.
real QuadraticAttenuation(float attenuation)
real QuadraticAttenuation(real attenuation)
{
return attenuation * attenuation;
}

// Combines SmoothQuadraticDistanceAttenuation() and SmoothAngleAttenuation() in an efficient manner.
// distances = {d, d^2, 1/d, d_proj}, where d_proj = dot(lightToSample, lightData.forward).
float SmoothPunctualLightAttenuation(float4 distances, real invSqrAttenuationRadius,
real SmoothPunctualLightAttenuation(real4 distances, real invSqrAttenuationRadius,
float distSq = distances.y;
float distRcp = distances.z;
float distProj = distances.w;
float cosFwd = distProj * distRcp;
real distSq = distances.y;
real distRcp = distances.z;
real distProj = distances.w;
real cosFwd = distProj * distRcp;
real attenuation = min(distRcp, 1.0 / PUNCTUAL_LIGHT_THRESHOLD);
attenuation *= DistanceAttenuation(distSq, invSqrAttenuationRadius);

正在加载...
取消
保存