浏览代码

Use the Fibonacci sequence for convolving with GGX

/main
Evgenii Golubev 8 年前
当前提交
23f38d59
共有 3 个文件被更改,包括 60 次插入3 次删除
  1. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader
  2. 3
      Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl
  3. 58
      Assets/ScriptableRenderLoop/ShaderLibrary/Sampling.hlsl

2
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader


PerceptualRoughnessToRoughness(perceptualRoughness),
_MipMapCount,
_InvOmegaP,
64,
55, // Matches the size of the precomputed Fibonacci sequence
true);
return val;

3
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


return acc / sampleCount;
}
// 'sampleCount' must be 16, 32, 64 or 256.
// Ref: Listing 19 in "Moving Frostbite to PBR"
float4 IntegrateLD(TEXTURECUBE_ARGS(tex, sampl),
float3 V,

for (uint i = 0; i < sampleCount; ++i)
{
float2 u = Hammersley2dSeq(i, sampleCount);
float2 u = k_Fibonacci2dSeq55[i];
u = frac(u + randNum);
float3 H;

58
Assets/ScriptableRenderLoop/ShaderLibrary/Sampling.hlsl


return r;
}
static const float2 k_Fibonacci2dSeq55[] = {
float2(0.00000000, 0.00000000),
float2(0.61818182, 0.01818182),
float2(0.23636365, 0.03636364),
float2(0.85454547, 0.05454545),
float2(0.47272730, 0.07272727),
float2(0.09090900, 0.09090909),
float2(0.70909095, 0.10909091),
float2(0.32727289, 0.12727273),
float2(0.94545460, 0.14545454),
float2(0.56363630, 0.16363636),
float2(0.18181801, 0.18181819),
float2(0.80000019, 0.20000000),
float2(0.41818190, 0.21818182),
float2(0.03636360, 0.23636363),
float2(0.65454578, 0.25454545),
float2(0.27272701, 0.27272728),
float2(0.89090919, 0.29090908),
float2(0.50909138, 0.30909091),
float2(0.12727261, 0.32727271),
float2(0.74545479, 0.34545454),
float2(0.36363602, 0.36363637),
float2(0.98181820, 0.38181818),
float2(0.60000038, 0.40000001),
float2(0.21818161, 0.41818181),
float2(0.83636379, 0.43636364),
float2(0.45454597, 0.45454547),
float2(0.07272720, 0.47272727),
float2(0.69090843, 0.49090910),
float2(0.30909157, 0.50909090),
float2(0.92727280, 0.52727270),
float2(0.54545403, 0.54545456),
float2(0.16363716, 0.56363636),
float2(0.78181839, 0.58181816),
float2(0.39999962, 0.60000002),
float2(0.01818275, 0.61818182),
float2(0.63636398, 0.63636363),
float2(0.25454521, 0.65454543),
float2(0.87272835, 0.67272729),
float2(0.49090958, 0.69090909),
float2(0.10909081, 0.70909089),
float2(0.72727203, 0.72727275),
float2(0.34545517, 0.74545455),
float2(0.96363640, 0.76363635),
float2(0.58181763, 0.78181821),
float2(0.20000076, 0.80000001),
float2(0.81818199, 0.81818181),
float2(0.43636322, 0.83636361),
float2(0.05454636, 0.85454547),
float2(0.67272758, 0.87272727),
float2(0.29090881, 0.89090908),
float2(0.90909195, 0.90909094),
float2(0.52727318, 0.92727274),
float2(0.14545441, 0.94545454),
float2(0.76363754, 0.96363634),
float2(0.38181686, 0.98181820)
};
//-----------------------------------------------------------------------------
// Sampling function
// Reference : http://www.cs.virginia.edu/~jdl/bib/globillum/mis/shirley96.pdf + PBRT

正在加载...
取消
保存