浏览代码

Start integration at the origin of the ray

/Yibing-Project-2
GitHub 7 年前
当前提交
129985d3
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute

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


uint featureFlags = 0xFFFFFFFF; // TODO
float4 depthParams = _VBufferDepthEncodingParams;
float z0 = depthParams.x; // View space Z coordinate of the near plane
float t0 = z0 * ray.ratioLenToZ; // Distance to the near plane
float z0 = 0, t0 = 0; // Start at the origin of the ray
float de = rcp(VBUFFER_SLICE_COUNT); // Log-encoded distance between slices
float3 totalRadiance = 0;

#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
// to compute min/max light indices, and then use this range for the entire slice.
// TODO: the clustered code could be made faster & simpler.
clusterIndices[0] = GetLightClusterIndex(tileCoord, z0);
clusterDepths[0] = GetLightClusterMinDepthVS(tileCoord, clusterIndices[0]);
#endif // LIGHTLOOP_TILE_PASS

}
#ifdef LIGHTLOOP_TILE_PASS
// TODO: the clustered code could be made faster & simpler.
clusterIndices[1] = GetLightClusterIndex(tileCoord, z1);
clusterDepths[1] = GetLightClusterMinDepthVS(tileCoord, clusterIndices[1]);

正在加载...
取消
保存