浏览代码

Add a hack to reduce flickering due to undersampling

/Yibing-Project-2
Evgenii Golubev 7 年前
当前提交
924b5cb4
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 5
      ScriptableRenderPipeline/Core/ShaderLibrary/VolumeRendering.hlsl
  2. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute

5
ScriptableRenderPipeline/Core/ShaderLibrary/VolumeRendering.hlsl


void ImportanceSamplePunctualLight(float rndVal, float3 lightPosition,
float3 rayOrigin, float3 rayDirection,
float tMin, float tMax,
out float dist, out float rSq, out float rcpPdf)
out float dist, out float rSq, out float rcpPdf,
float minDistSq = FLT_EPS)
float rayToLightDistSq = max(originToLightDistSq - originToLightProj * originToLightProj, FLT_EPS);
float rayToLightDistSq = max(originToLightDistSq - originToLightProj * originToLightProj, minDistSq);
float a = tMin - originToLightProj;
float b = tMax - originToLightProj;

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute


if (sampleLight)
{
// We are unable to adequately sample features larger
// than the half of the length of the integration interval
// divided by the number of temporal samples (7).
// Therefore, we apply this hack to reduce flickering.
float hackMinDistSq = Sq(dt * (0.5 / 7));
tEntr, tExit, t, distSq, rcpPdf);
tEntr, tExit, t, distSq, rcpPdf,
hackMinDistSq);
posInput.positionWS = GetPointAtDistance(ray, t);

正在加载...
取消
保存