|
|
|
|
|
|
return (uint)logVolume << 20 | (uint)lightVolumeType << 17 | listType << 16 | ((uint)probeIndex & 0xFFFF); |
|
|
|
} |
|
|
|
|
|
|
|
void VoxelLightListGeneration(CommandBuffer cmd, HDCamera hdCamera, Matrix4x4 projscr, Matrix4x4 invProjscr, RenderTargetIdentifier cameraDepthBufferRT) |
|
|
|
void VoxelLightListGeneration(CommandBuffer cmd, HDCamera hdCamera, Matrix4x4[] projscrArr, Matrix4x4[] invProjscrArr, RenderTargetIdentifier cameraDepthBufferRT) |
|
|
|
{ |
|
|
|
Camera camera = hdCamera.camera; |
|
|
|
// clear atomic offset index
|
|
|
|
|
|
|
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs._EnvLightIndexShift, m_lightList.lights.Count); |
|
|
|
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs._DecalIndexShift, m_lightList.lights.Count + m_lightList.envLights.Count); |
|
|
|
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs.g_iNrVisibLights, m_lightCount); |
|
|
|
cmd.SetComputeMatrixParam(buildPerVoxelLightListShader, HDShaderIDs.g_mScrProjection, projscr); |
|
|
|
cmd.SetComputeMatrixParam(buildPerVoxelLightListShader, HDShaderIDs.g_mInvScrProjection, invProjscr); |
|
|
|
cmd.SetComputeMatrixArrayParam(buildPerVoxelLightListShader, HDShaderIDs.g_mScrProjectionArr, projscrArr); |
|
|
|
cmd.SetComputeMatrixArrayParam(buildPerVoxelLightListShader, HDShaderIDs.g_mInvScrProjectionArr, invProjscrArr); |
|
|
|
|
|
|
|
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs.g_iLog2NumClusters, k_Log2NumClusters); |
|
|
|
|
|
|
|
|
|
|
// of the frustum with the max half-angle). We don't need the light information in
|
|
|
|
// real projection space. We just use screen space to figure out what is proximal
|
|
|
|
// to a cluster or tile.
|
|
|
|
// Once we generate this non-oblique projection matrix, it can be shared across both eyes (un-array)
|
|
|
|
for (int eyeIndex = 0; eyeIndex < 2; eyeIndex++) |
|
|
|
{ |
|
|
|
projArr[eyeIndex] = CameraProjectionStereoLHS(hdCamera.camera, (Camera.StereoscopicEye)eyeIndex); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Cluster
|
|
|
|
VoxelLightListGeneration(cmd, hdCamera, projscrArr[0], invProjscrArr[0], cameraDepthBufferRT); |
|
|
|
VoxelLightListGeneration(cmd, hdCamera, projscrArr, invProjscrArr, cameraDepthBufferRT); |
|
|
|
|
|
|
|
if (enableFeatureVariants) |
|
|
|
{ |
|
|
|