This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See https://github.com/jbikker/tinybvh | |
PhysX is a general purpose library not focused on raycasts and the best setup for raycast performance may not be obvious. | |
Here is the code I used in the tiny BVH benchmark. Results: https://x.com/PierreTerdiman/status/1854629430246748455 | |
Adapted from https://github.com/NVIDIA-Omniverse/PhysX/tree/main/physx/snippets/snippetpathtracing | |
For building: | |
#ifdef PHYSX_BUILD | |
const bool quantized = false; // quantized trees use less memory but are usually slower for raycasts | |
const bool useSAH = false; // SAH build is much slower but can give slightly better perf. Not the PhysX default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctype.h> | |
#include <chrono> | |
#include <iostream> | |
#include "PxPhysicsAPI.h" | |
#include "../snippetcommon/SnippetPrint.h" | |
#include "../snippetcommon/SnippetPVD.h" | |
#include "../snippetutils/SnippetUtils.h" | |
#ifdef RENDER_SNIPPET | |
#include "../snippetrender/SnippetRender.h" | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef SAFE_VERSION | |
#define SIMD_OVERLAP_TEST (_mm_movemask_ps(_mm_cmpngt_ps(b, _mm_load_ps(box)))==15) | |
#else | |
#define SIMD_OVERLAP_TEST (_mm_movemask_ps(_mm_cmpnle_ps(_mm_load_ps(box), b))==12) | |
#endif | |
bool Meshmerizer::CompleteBoxPruning(udword nb, const AABB* list, Container& pairs) | |
{ | |
// Checkings |