|
|
|
|
|
|
float3 originWS; |
|
|
|
float3 directionWS; // Normalized |
|
|
|
float ratioLenToZ; // 1 / ViewSpaceZ |
|
|
|
float ratioZtoLen; // ViewSpaceZ |
|
|
|
}; |
|
|
|
|
|
|
|
float3 GetPointAtDistance(Ray ray, float t) |
|
|
|
|
|
|
|
|
|
|
Ray ray; |
|
|
|
ray.originWS = GetCurrentViewPosition(); |
|
|
|
ray.ratioLenToZ = sqrt(dot(dir, dir)); |
|
|
|
ray.ratioZtoLen = rsqrt(dot(dir, dir)); |
|
|
|
ray.directionWS = dir * ray.ratioZtoLen; |
|
|
|
ray.ratioLenToZ = length(dir); |
|
|
|
ray.directionWS = normalize(dir); |
|
|
|
|
|
|
|
FillVolumetricLightingBuffer(ray, voxelCoord, tileCoord); |
|
|
|
} |