KiCad PCB EDA Suite
|
#include <bvh_pbrt.h>
Public Member Functions | |
BVH_PBRT (const CONTAINER_3D_BASE &aObjectContainer, int aMaxPrimsInNode=4, SPLITMETHOD aSplitMethod=SPLITMETHOD::SAH) | |
~BVH_PBRT () | |
bool | Intersect (const RAY &aRay, HITINFO &aHitInfo) const override |
bool | Intersect (const RAY &aRay, HITINFO &aHitInfo, unsigned int aAccNodeInfo) const override |
bool | Intersect (const RAYPACKET &aRayPacket, HITINFO_PACKET *aHitInfoPacket) const override |
bool | IntersectP (const RAY &aRay, float aMaxDistance) const override |
Protected Attributes | |
BBOX_3D | m_bbox |
Private Member Functions | |
BVHBuildNode * | recursiveBuild (std::vector< BVHPrimitiveInfo > &primitiveInfo, int start, int end, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims) |
BVHBuildNode * | HLBVHBuild (const std::vector< BVHPrimitiveInfo > &primitiveInfo, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims) |
BVHBuildNode * | emitLBVH (BVHBuildNode *&buildNodes, const std::vector< BVHPrimitiveInfo > &primitiveInfo, MortonPrimitive *mortonPrims, int nPrimitives, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims, int *orderedPrimsOffset, int bit) |
TODO: after implement memory arena, put const back to this functions. | |
BVHBuildNode * | buildUpperSAH (std::vector< BVHBuildNode * > &treeletRoots, int start, int end, int *totalNodes) |
int | flattenBVHTree (BVHBuildNode *node, uint32_t *offset) |
Private Attributes | |
const int | m_maxPrimsInNode |
SPLITMETHOD | m_splitMethod |
CONST_VECTOR_OBJECT | m_primitives |
LinearBVHNode * | m_nodes |
std::list< void * > | m_nodesToFree |
unsigned int | m_I [RAYPACKET_RAYS_PER_PACKET] |
Definition at line 110 of file bvh_pbrt.h.
BVH_PBRT::BVH_PBRT | ( | const CONTAINER_3D_BASE & | aObjectContainer, |
int | aMaxPrimsInNode = 4 , |
||
SPLITMETHOD | aSplitMethod = SPLITMETHOD::SAH |
||
) |
Definition at line 235 of file bvh_pbrt.cpp.
References LinearBVHNode::axis, LinearBVHNode::bounds, CONTAINER_3D_BASE::ConvertTo(), flattenBVHTree(), CONTAINER_3D_BASE::GetList(), HLBVHBuild(), m_I, m_nodes, m_nodesToFree, m_primitives, m_splitMethod, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, RAYPACKET_RAYS_PER_PACKET, recursiveBuild(), and BBOX_3D::Reset().
BVH_PBRT::~BVH_PBRT | ( | ) |
Definition at line 306 of file bvh_pbrt.cpp.
References m_nodesToFree.
|
private |
Definition at line 894 of file bvh_pbrt.cpp.
References BVHBuildNode::bounds, BucketInfo::bounds, buildUpperSAH(), BVHBuildNode::children, BucketInfo::count, BVHBuildNode::firstPrimOffset, BVHBuildNode::InitInterior(), m_nodesToFree, BBOX_3D::Max(), BBOX_3D::MaxDimension(), BBOX_3D::Min(), BVHBuildNode::nPrimitives, BBOX_3D::Reset(), BVHBuildNode::splitAxis, BBOX_3D::SurfaceArea(), and BBOX_3D::Union().
Referenced by buildUpperSAH(), and HLBVHBuild().
|
private |
TODO: after implement memory arena, put const back to this functions.
Definition at line 795 of file bvh_pbrt.cpp.
References emitLBVH(), BVHBuildNode::InitInterior(), BVHBuildNode::InitLeaf(), m_maxPrimsInNode, m_primitives, MortonPrimitive::mortonCode, MortonPrimitive::primitiveIndex, BBOX_3D::Reset(), and BBOX_3D::Union().
Referenced by emitLBVH(), and HLBVHBuild().
|
private |
Definition at line 1034 of file bvh_pbrt.cpp.
References LinearBVHNode::axis, BVHBuildNode::bounds, LinearBVHNode::bounds, BVHBuildNode::children, BVHBuildNode::firstPrimOffset, flattenBVHTree(), m_nodes, BVHBuildNode::nPrimitives, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, LinearBVHNode::secondChildOffset, and BVHBuildNode::splitAxis.
Referenced by BVH_PBRT(), and flattenBVHTree().
|
private |
Definition at line 678 of file bvh_pbrt.cpp.
References BVHBuildNode::bounds, LBVHTreelet::buildNodes, buildUpperSAH(), BVHBuildNode::children, emitLBVH(), EncodeMorton3(), BVHBuildNode::firstPrimOffset, m_nodesToFree, m_primitives, BVHBuildNode::nPrimitives, LBVHTreelet::numPrimitives, BBOX_3D::Offset(), RadixSort(), BBOX_3D::Reset(), BVHBuildNode::splitAxis, LBVHTreelet::startIndex, and BBOX_3D::Union().
Referenced by BVH_PBRT().
Implements ACCELERATOR_3D.
Definition at line 1066 of file bvh_pbrt.cpp.
References LinearBVHNode::axis, LinearBVHNode::bounds, BBOX_3D::Intersect(), HITINFO::m_acc_node_info, RAY::m_dirIsNeg, m_nodes, m_primitives, HITINFO::m_tHit, MAX_TODOS, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, and LinearBVHNode::secondChildOffset.
|
overridevirtual |
Implements ACCELERATOR_3D.
Definition at line 1131 of file bvh_pbrt.cpp.
References LinearBVHNode::axis, LinearBVHNode::bounds, BBOX_3D::Intersect(), RAY::m_dirIsNeg, m_nodes, m_primitives, HITINFO::m_tHit, MAX_TODOS, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, and LinearBVHNode::secondChildOffset.
|
overridevirtual |
Implements ACCELERATOR_3D.
Definition at line 92 of file bvh_packet_traversal.cpp.
References LinearBVHNode::bounds, StackNode::cell, OBJECT_3D::GetBBox(), getFirstHit(), getLastHit(), StackNode::ia, FRUSTUM::Intersect(), OBJECT_3D::Intersect(), HITINFO::m_acc_node_info, RAYPACKET::m_Frustum, HITINFO_PACKET::m_HitInfo, HITINFO_PACKET::m_hitresult, m_nodes, m_primitives, RAYPACKET::m_ray, MAX_TODOS, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, RAYPACKET_RAYS_PER_PACKET, and LinearBVHNode::secondChildOffset.
|
overridevirtual |
Implements ACCELERATOR_3D.
Definition at line 1195 of file bvh_pbrt.cpp.
References LinearBVHNode::axis, LinearBVHNode::bounds, MATERIAL::GetCastShadows(), OBJECT_3D::GetMaterial(), BBOX_3D::Intersect(), OBJECT_3D::IntersectP(), RAY::m_dirIsNeg, m_nodes, m_primitives, MAX_TODOS, LinearBVHNode::nPrimitives, LinearBVHNode::primitivesOffset, and LinearBVHNode::secondChildOffset.
|
private |
Definition at line 426 of file bvh_pbrt.cpp.
References BVHBuildNode::bounds, BucketInfo::bounds, BVHBuildNode::children, BucketInfo::count, BVHBuildNode::firstPrimOffset, BBOX_3D::GetCenter(), BVHBuildNode::InitInterior(), BVHBuildNode::InitLeaf(), KI_FALLTHROUGH, m_maxPrimsInNode, m_nodesToFree, m_primitives, m_splitMethod, BBOX_3D::Max(), BBOX_3D::MaxDimension(), BBOX_3D::Min(), BVHBuildNode::nPrimitives, BBOX_3D::Offset(), recursiveBuild(), BBOX_3D::Reset(), BVHBuildNode::splitAxis, BBOX_3D::SurfaceArea(), and BBOX_3D::Union().
Referenced by BVH_PBRT(), and recursiveBuild().
|
protectedinherited |
Definition at line 53 of file accelerator_3d.h.
Referenced by ACCELERATOR_3D::ACCELERATOR_3D().
|
private |
Definition at line 150 of file bvh_pbrt.h.
Referenced by BVH_PBRT().
|
private |
Definition at line 142 of file bvh_pbrt.h.
Referenced by emitLBVH(), and recursiveBuild().
|
private |
Definition at line 145 of file bvh_pbrt.h.
Referenced by BVH_PBRT(), flattenBVHTree(), Intersect(), and IntersectP().
|
private |
Definition at line 147 of file bvh_pbrt.h.
Referenced by buildUpperSAH(), BVH_PBRT(), HLBVHBuild(), recursiveBuild(), and ~BVH_PBRT().
|
private |
Definition at line 144 of file bvh_pbrt.h.
Referenced by BVH_PBRT(), emitLBVH(), HLBVHBuild(), Intersect(), IntersectP(), and recursiveBuild().
|
private |
Definition at line 143 of file bvh_pbrt.h.
Referenced by BVH_PBRT(), and recursiveBuild().