Optimize SSAO rendering with depth bounds and half-res depth buffer
This commit is contained in:
@@ -695,6 +695,15 @@ Float2 RenderTools::GetDepthBounds(const RenderView& view, const OrientedBoundin
|
||||
return GetDepthBounds(view, Span<Float3>(corners, 8));
|
||||
}
|
||||
|
||||
float RenderTools::GetDepthBounds(const RenderView& view, const Float3& point)
|
||||
{
|
||||
const Float4 pointClip = Matrix::TransformPosition(view.ViewProjection(), Float4(point, 1.0));
|
||||
float depth = pointClip.Z / pointClip.W;
|
||||
if (depth >= 1.0f)
|
||||
depth = 0.0f; // Point is behind the view
|
||||
return Math::Clamp(depth, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
Float3 RenderTools::GetColorQuantizationError(PixelFormat format)
|
||||
{
|
||||
Float3 mantissaBits;
|
||||
|
||||
Reference in New Issue
Block a user