OWL
|
#include <InstanceGroup.h>
Classes | |
struct | DeviceData |
Public Types | |
typedef std::shared_ptr< InstanceGroup > | SP |
Public Types inherited from owl::Group | |
typedef std::shared_ptr< Group > | SP |
Public Types inherited from owl::ContextObject | |
typedef std::shared_ptr< ContextObject > | SP |
Public Types inherited from owl::Object | |
typedef std::shared_ptr< Object > | SP |
Public Member Functions | |
InstanceGroup (Context *const context, size_t numChildren, Group::SP *groups, unsigned int buildFlags, bool useInstanceProgram) | |
std::string | toString () const override |
void | setChild (size_t childID, Group::SP child) |
void | setTransform (size_t childID, const affine3f &xfm) |
void | setTransforms (uint32_t timeStep, const float *floatsForThisStimeStep, OWLMatrixFormat matrixFormat) |
void | setInstanceIDs (const uint32_t *instanceIDs) |
void | setVisibilityMasks (const uint8_t *visibilityMasks) |
void | setInstanceProg (Module::SP module, const std::string &progName) |
void | setMotionInstanceProg (Module::SP module, const std::string &progName) |
void | buildInstanceProg () |
void | buildMotionInstanceProg () |
void | buildAccel (LaunchParams::SP launchParams=nullptr) override |
void | refitAccel (LaunchParams::SP launchParams=nullptr) override |
RegisteredObject::DeviceData::SP | createOn (const DeviceContext::SP &device) override |
DeviceData & | getDD (const DeviceContext::SP &device) const |
template<bool FULL_REBUILD> | |
void | staticBuildOn (const DeviceContext::SP &device) |
template<bool FULL_REBUILD> | |
void | motionBlurBuildOn (const DeviceContext::SP &device) |
template<bool FULL_REBUILD> | |
void | staticDeviceBuildOn (const DeviceContext::SP &device, LaunchParams::SP launchParams) |
template<bool FULL_REBUILD> | |
void | motionBlurDeviceBuildOn (const DeviceContext::SP &device, LaunchParams::SP launchParams) |
int | getSBTOffset () const override |
Public Member Functions inherited from owl::Group | |
Group (Context *const context, ObjectRegistry ®istry) | |
std::string | toString () const override |
virtual void | buildAccel (LaunchParams::SP launchParams=nullptr)=0 |
virtual void | refitAccel (LaunchParams::SP launchParams=nullptr)=0 |
virtual int | getSBTOffset () const =0 |
DeviceData & | getDD (const DeviceContext::SP &device) const |
RegisteredObject::DeviceData::SP | createOn (const DeviceContext::SP &device) override |
OptixTraversableHandle | getTraversable (const DeviceContext::SP &device) const |
void | getAccelSize (size_t &memFinal, size_t &memPeak) |
Public Member Functions inherited from owl::RegisteredObject | |
RegisteredObject (Context *const context, ObjectRegistry ®istry) | |
Public Member Functions inherited from owl::ContextObject | |
ContextObject (Context *const context) | |
std::string | toString () const override |
Public Member Functions inherited from owl::Object | |
Object () | |
virtual std::string | toString () const |
virtual DeviceData::SP | createOn (const std::shared_ptr< DeviceContext > &device) |
void | createDeviceData (const std::vector< std::shared_ptr< DeviceContext > > &devices) |
template<typename T > | |
std::shared_ptr< T > | as () |
Public Attributes | |
size_t | numChildren |
std::vector< Group::SP > | children |
std::vector< affine3f > | transforms [2] |
std::vector< uint32_t > | instanceIDs |
std::vector< uint8_t > | visibilityMasks |
Public Attributes inherited from owl::Group | |
box3f | bounds [2] |
Public Attributes inherited from owl::RegisteredObject | |
int | ID |
ObjectRegistry & | registry |
Public Attributes inherited from owl::ContextObject | |
Context *const | context |
Public Attributes inherited from owl::Object | |
const size_t | uniqueID |
std::vector< DeviceData::SP > | deviceData |
Static Public Attributes | |
static constexpr unsigned int | defaultBuildFlags |
Static Public Attributes inherited from owl::Object | |
static std::atomic< uint64_t > | nextAvailableID |
Protected Attributes | |
const unsigned int | buildFlags |
bool | useInstanceProgram |
ProgramDesc | instanceProg |
ProgramDesc | motionInstanceProg |
a OWL Group / BVH over instances (i.e., a IAS)
owl::InstanceGroup::InstanceGroup | ( | Context *const | context, |
size_t | numChildren, | ||
Group::SP * | groups, | ||
unsigned int | buildFlags, | ||
bool | useInstanceProgram | ||
) |
construct with given array of groups - transforms can be specified later
|
overridevirtual |
re*build* this accel - actual work depens on subclass
Implements owl::Group.
void owl::InstanceGroup::buildInstanceProg | ( | ) |
build the CUDA instance program kernel (if instance prog is set)
void owl::InstanceGroup::buildMotionInstanceProg | ( | ) |
build the CUDA motion instance program kernel (if motion instance prog is set)
|
override |
creates the device-specific data for this group
|
inline |
get reference to given device-specific data for this object
|
inlineoverridevirtual |
return the SBT offset to use for this group - SBT offsets for instnace groups are always 0
Implements owl::Group.
|
overridevirtual |
re*fit* this accel - actual work depens on subclass
Implements owl::Group.
void owl::InstanceGroup::setChild | ( | size_t | childID, |
Group::SP | child | ||
) |
set given child to given group
void owl::InstanceGroup::setInstanceProg | ( | Module::SP | module, |
const std::string & | progName | ||
) |
set instance program to run for this IAS
void owl::InstanceGroup::setMotionInstanceProg | ( | Module::SP | module, |
const std::string & | progName | ||
) |
set motion instance program to run for this IAS
void owl::InstanceGroup::setTransform | ( | size_t | childID, |
const affine3f & | xfm | ||
) |
set transformation matrix of given child
void owl::InstanceGroup::setTransforms | ( | uint32_t | timeStep, |
const float * | floatsForThisStimeStep, | ||
OWLMatrixFormat | matrixFormat | ||
) |
set transformation matrix of given child
|
overridevirtual |
pretty-printer, for printf-debugging
Reimplemented from owl::Group.
std::vector<Group::SP> owl::InstanceGroup::children |
the list of children - note we do have to keep them both in the ll layer and here for the refcounting to work; the transforms are only stored once, on the ll layer
|
staticconstexpr |
std::vector<uint32_t> owl::InstanceGroup::instanceIDs |
vector of instnace IDs to use for these instances - if not specified we/optix will fill in automatically using instanceID=childID
|
protected |
the instance prog to run for this type
|
protected |
the motion instance prog to run for this type (if motion blur is enabled)
size_t owl::InstanceGroup::numChildren |
number of children in this group
std::vector<affine3f> owl::InstanceGroup::transforms[2] |
set of transform matrices for t=0 and t=1, respectively. if we don't use motion blur, the second one may be unused
|
protected |
if true, we use the instance program to generate the instances
std::vector<uint8_t> owl::InstanceGroup::visibilityMasks |
vector of visibility masks to use for these instances - if not specified we/optix will fill in automatically using visibility=255