浏览代码

Add a #define to control reprojection

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

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


#pragma enable_d3d11_debug_symbols
#define DEBUG_REPROJECTION 0
#define ENABLE_REPROJECTION 0
#define DEBUG_REPROJECTION 0
#include "../../../ShaderPass/ShaderPass.cs.hlsl"
#define SHADERPASS SHADERPASS_VOLUMETRIC_LIGHTING

);
#endif
#if ENABLE_REPROJECTION
// Reproject the history at 'centerWS'.
// TODO! WARNING! THE REPROJECTED VALUE IS AN INTEGRAL OVER A SEGMENT, THE LENGTH OF THE CURRENT SEGMENT IS DIFFERENT, ACCOUNT FOR THAT!
float2 reprojPosNDC = ComputeNormalizedDeviceCoordinates(centerWS, _PrevViewProjMatrix);

// Store the feedback.
_VBufferLightingFeedback[uint3(posInput.positionSS, slice)] = float4(blendedRadiance, 1);
#else
float3 blendedRadiance = voxelRadiance;
#endif
#if (DEBUG_REPROJECTION != 0)
#if DEBUG_REPROJECTION
if (distance(voxelRadiance, reprojValue.rgb) > 0.1) blendedRadiance = float3(1000, 0, 0);
#endif

return;
}
#if ENABLE_REPROJECTION
// float2 sampleCoord = voxelCoord + 0.5;
#else
float2 sampleCoord = voxelCoord + 0.5;
#endif
// Compute the ray direction s.t. its ViewSpaceZ = 1.
float3 dir = -mul(float3(sampleCoord, 1), (float3x3)_VBufferCoordToViewDirWS);

正在加载...
取消
保存