From 0cc841bc76eda21793f2a158b0ededad5a5ae3bf Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 16 Sep 2020 16:11:56 -0700 Subject: Added GPU vendor and memory size detection (API 240071), closed https://github.com/DiligentGraphics/DiligentCore/issues/144. Fixed shader model selection in D3D12 backend --- Common/interface/AdvancedMath.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Common/interface') diff --git a/Common/interface/AdvancedMath.hpp b/Common/interface/AdvancedMath.hpp index b48da1bc..8d1119e5 100644 --- a/Common/interface/AdvancedMath.hpp +++ b/Common/interface/AdvancedMath.hpp @@ -88,6 +88,14 @@ struct ViewFrustumExt : public ViewFrustum // For OpenGL, matrix is still considered row-major. The only difference is that // near clip plane is at -1, not 0. +// +// Note that returned plane normal vectors are not normalized, which does not make a difference +// when testing a point against the plane: +// +// IsPointInsidePlane = dot(Plane.Normal, Point) < Plane.Distance +// +// However, to use the planes with other distances (e.g. for testing a sphere against the plane), +// the normal vectors must be normalized and the distances scaled accordingly. inline void ExtractViewFrustumPlanesFromMatrix(const float4x4& Matrix, ViewFrustum& Frustum, bool bIsOpenGL) { // For more details, see Gribb G., Hartmann K., "Fast Extraction of Viewing Frustum Planes from the -- cgit v1.2.3