|
|
|
|
|
|
float3 rayOriginWS = float3(0, 0, 0); |
|
|
|
float3 rayDirWS = float3(0, 0, 0); |
|
|
|
float mipLevel = 0; |
|
|
|
#if DEBUG_DISPLAY |
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
int debugMode = 0; |
|
|
|
#endif |
|
|
|
float invScreenWeightDistance = 0; |
|
|
|
|
|
|
rayDirWS = preLightData.transparentRefractV; |
|
|
|
mipLevel = preLightData.transparentSSMipLevel; |
|
|
|
invScreenWeightDistance = _SSRefractionInvScreenWeightDistance; |
|
|
|
#if DEBUG_DISPLAY |
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
debugMode = DEBUGLIGHTINGMODE_SCREEN_SPACE_TRACING_REFRACTION; |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
rayDirWS = preLightData.iblR; |
|
|
|
mipLevel = PositivePow(preLightData.iblPerceptualRoughness, 0.8) * uint(max(_ColorPyramidScale.z - 1, 0)); |
|
|
|
invScreenWeightDistance = _SSReflectionInvScreenWeightDistance; |
|
|
|
#if DEBUG_DISPLAY |
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
#if DEBUG_DISPLAY |
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
bool debug = _DebugLightingMode == debugMode |
|
|
|
&& !any(int2(_MouseClickPixelCoord.xy) - int2(posInput.positionSS)); |
|
|
|
#endif |
|
|
|
|
|
|
// Jitter the ray origin to trade some noise instead of banding effect |
|
|
|
ssRayInput.rayOriginWS = rayOriginWS + rayDirWS * SampleBayer4(posInput.positionSS + uint2(_FrameCount, uint(_FrameCount) / 4u)) * 0.1; |
|
|
|
ssRayInput.rayDirWS = rayDirWS; |
|
|
|
#if DEBUG_DISPLAY |
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
ssRayInput.debug = debug; |
|
|
|
#endif |
|
|
|
|
|
|
|