浏览代码

Evaluate the ambient probe outside of the loop

/main
Evgenii Golubev 7 年前
当前提交
bdb7b999
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/Resources/VolumetricLighting.compute

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/Resources/VolumetricLighting.compute


float t0 = ray.strataDirInvViewZ * z0; // Convert view space Z to distance along the stratified ray
float de = rcp(VBUFFER_SLICE_COUNT); // Log-encoded distance between slices
// The contribution of the ambient probe does not depend on the position,
// only on the direction and the length of the interval.
float3 probeInScatteredRadiance = EvaluateLightProbe(GetPreconvolvedAmbientProbe(), ray.centerDirWS);
float3 totalRadiance = 0;
float opticalDepth = 0;

float phase = IsotropicPhaseFunction();
#endif
// Sample the light probe.
float3 probeRadiance = EvaluateLightProbe(GetPreconvolvedAmbientProbe(), ray.centerDirWS) * TransmittanceIntegralHomogeneousMedium(extinction, dt);
// Integrate the contribution of the probe over the interval.
float3 probeRadiance = probeInScatteredRadiance * TransmittanceIntegralHomogeneousMedium(extinction, dt);
totalRadiance += transmittance * scattering * (phase * blendedRadiance + probeRadiance);
// Compute the optical depth up to the center of the interval.

正在加载...
取消
保存