浏览代码

Enable reversebits() from the SM 5.0

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

4
Assets/ScriptableRenderLoop/ShaderLibrary/Sampling.hlsl


// Ref: http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
uint ReverseBits32(uint bits)
{
#if 0 // Shader model 5
#if 1 // Shader model 5
return reversebits(bits);
#else
bits = (bits << 16) | (bits >> 16);

Ns = UniformSampleSphere(u1, u2);
// Transform from unit sphere to world space
// Transform from unit sphere to world space
P = radius * Ns + localToWorld[3].xyz;
// pdf is inverse of area

正在加载...
取消
保存