m_CameraStencilBufferCopy=RTHandle.Alloc(Vector2.one,depthBufferBits:DepthBits.None,colorFormat:RenderTextureFormat.R8,sRGB:false,filterMode:FilterMode.Point,enableMSAA:true);// DXGI_FORMAT_R8_UINT is not supported by Unity
m_CameraStencilBufferCopy=RTHandle.Alloc(Vector2.one,depthBufferBits:DepthBits.None,colorFormat:RenderTextureFormat.R8,sRGB:false,filterMode:FilterMode.Point,enableMSAA:true,name:"CameraStencilCopy");// DXGI_FORMAT_R8_UINT is not supported by Unity
m_DepthPyramidBuffer=RTHandle.Alloc(size=>CalculatePyramidSize(size),filterMode:FilterMode.Trilinear,colorFormat:RenderTextureFormat.RFloat,sRGB:false,useMipMap:true,autoGenerateMips:false,enableRandomWrite:true);// Need randomReadWrite because we downsample the first mip with a compute shader.
m_DepthPyramidBuffer=RTHandle.Alloc(size=>CalculatePyramidSize(size),filterMode:FilterMode.Trilinear,colorFormat:RenderTextureFormat.RFloat,sRGB:false,useMipMap:true,autoGenerateMips:false,enableRandomWrite:true,name:"DepthPyramid");// Need randomReadWrite because we downsample the first mip with a compute shader.
}
publicvoidDestroyBuffers()
for(inti=currentLodCount;i<lodCount;++i)
{
intmipIndexCopy=i+1;// Don't remove this copy! It's important for the value to be correctly captured by the lambda.