浏览代码

Update the reference

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

11
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/VolumeRendering.hlsl


// Samples the interval of homogeneous participating medium using the closed-form tracking approach
// (proportionally to the transmittance).
// Returns the offset from the start of the interval and the weight = (transmittance / pdf).
// Ref: Production Volume Rendering, 3.6.1.
// Ref: Monte Carlo Methods for Volumetric Light Transport Simulation, p. 5.
// pdf = extinction * exp(-extinction * t) / (1 - exp(-intervalLength * extinction))
// pdf = extinction * exp(extinction * (intervalLength - t)) / (exp(intervalLength * extinction - 1)
// weight = (1 - exp(-extinction * intervalLength)) / extinction;
// weight = (1 - exp(-extinction * intervalLength)) / extinction
real c = rcp(extinction);
weight = x * rcp(extinction);
offset = -log(1 - rndVal * x) * rcp(extinction);
weight = x * c;
offset = -log(1 - rndVal * x) * c;
}
// Implements equiangular light sampling.

正在加载...
取消
保存