|
|
|
|
|
|
float3 totalRadiance = 0; |
|
|
|
float opticalDepth = 0; |
|
|
|
|
|
|
|
uint sliceCountHack = max(VBUFFER_SLICE_COUNT, (uint)_VBufferDepthEncodingParams.w); // Prevent unrolling... |
|
|
|
|
|
|
|
#ifdef LIGHTLOOP_TILE_PASS |
|
|
|
// Our voxel is not necessarily completely inside a single light cluster. |
|
|
|
// Note that Z-binning can solve this problem, as we can iterate over all Z-bins |
|
|
|
|
|
|
clusterDepths[0] = GetLightClusterMinLinearDepth(posInput.tileCoord, clusterIndices[0]); |
|
|
|
#endif // LIGHTLOOP_TILE_PASS |
|
|
|
|
|
|
|
#if defined(SHADER_API_METAL) |
|
|
|
[fastopt] |
|
|
|
for (uint slice = 0; slice < VBUFFER_SLICE_COUNT; slice++) |
|
|
|
#else |
|
|
|
uint sliceCountHack = max(VBUFFER_SLICE_COUNT, (uint)_VBufferDepthEncodingParams.w); // Prevent unrolling... |
|
|
|
|
|
|
|
#endif |
|
|
|
#if defined(SHADER_API_METAL) |
|
|
|
float z1 = DecodeLogarithmicDepth(e1, _VBufferDepthDecodingParams); |
|
|
|
#else |
|
|
|
#endif |
|
|
|
float t1 = ray.strataDirInvViewZ * z1; // Convert view space Z to distance along the stratified ray |
|
|
|
float dt = t1 - t0; |
|
|
|
|
|
|
|