浏览代码

Fix numerical integration issues

/main
Evgenii Golubev 8 年前
当前提交
2c052fee
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 4
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl
  2. 3
      Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl

4
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


BSDF(V, L, positionWS, preLightData, bsdfData, lightDiff, lightSpec);
// The value of the specular BSDF could be infinite.
// Summing up infinities leads to NaNs.
lightSpec = min(lightSpec, FLT_MAX);
diffuseLighting += lightDiff * (sinLT / dist2 * NdotL);
specularLighting += lightSpec * (sinLT / dist2 * NdotL);
}

3
Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl


#define HALF_PI 1.57079632679
#define INV_HALF_PI 0.636619772367
#define FLT_EPSILON 1.192092896e-07f // smallest such that 1.0 + FLT_EPSILON != 1.0
#define FLT_EPSILON 1.192092896e-07 // Smallest positive number, such that 1.0 + FLT_EPSILON != 1.0
#define FLT_MAX 3.402823466e+38 // Maximum representable floating-point number
#define MERGE_NAME(X, Y) X##Y

正在加载...
取消
保存