浏览代码

Use the optimized version of Hammersley2d() by default

/main
Evgenii Golubev 8 年前
当前提交
2b99d652
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 12
      Assets/ScriptableRenderLoop/ShaderLibrary/Hammersley2D.hlsl

12
Assets/ScriptableRenderLoop/ShaderLibrary/Hammersley2D.hlsl


return float(ReverseBits32(bits)) * 2.3283064365386963e-10; // 0x100000000
}
float2 Hammersley2d(uint i, uint maxSampleCount)
float2 Hammersley2dSeq(uint i, uint sequenceLength)
return float2(float(i) / float(maxSampleCount), RadicalInverse_VdC(i));
return float2(float(i) / float(sequenceLength), RadicalInverse_VdC(i));
}
static const float2 k_Hammersley2dSeq16[] = {

float2(0.99609375, 0.99609375)
};
// Loads sequence elements from one of the precomputed tables.
// Valid sequence lengths: 16, 32, 64, 256. Returns 0 otherwise.
float2 Hammersley2dSeq(uint i, uint sequenceLength)
// Loads elements from one of the precomputed tables for sequence lengths of 16, 32, 64, 256.
// Computes the values at runtime otherwise.
float2 Hammersley2d(uint i, uint sequenceLength)
{
switch (sequenceLength)
{

case 256: return k_Hammersley2dSeq256[i];
default: return float2(0.0, 0.0);
default: return Hammersley2dSeq(i, sequenceLength);
}
}
正在加载...
取消
保存