OWL
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
owl::InstanceGroup Struct Reference

#include <InstanceGroup.h>

Inheritance diagram for owl::InstanceGroup:
owl::Group owl::RegisteredObject owl::ContextObject owl::Object

Classes

struct  DeviceData
 

Public Types

typedef std::shared_ptr< InstanceGroupSP
 
- Public Types inherited from owl::Group
typedef std::shared_ptr< GroupSP
 
- Public Types inherited from owl::ContextObject
typedef std::shared_ptr< ContextObjectSP
 
- Public Types inherited from owl::Object
typedef std::shared_ptr< ObjectSP
 

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
 
DeviceDatagetDD (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 &registry)
 
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
 
DeviceDatagetDD (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 &registry)
 
- 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< affine3ftransforms [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
 
ObjectRegistryregistry
 
- 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
 

Detailed Description

a OWL Group / BVH over instances (i.e., a IAS)

Constructor & Destructor Documentation

◆ InstanceGroup()

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

Member Function Documentation

◆ buildAccel()

void owl::InstanceGroup::buildAccel ( LaunchParams::SP  launchParams = nullptr)
overridevirtual

re*build* this accel - actual work depens on subclass

Implements owl::Group.

◆ buildInstanceProg()

void owl::InstanceGroup::buildInstanceProg ( )

build the CUDA instance program kernel (if instance prog is set)

◆ buildMotionInstanceProg()

void owl::InstanceGroup::buildMotionInstanceProg ( )

build the CUDA motion instance program kernel (if motion instance prog is set)

◆ createOn()

RegisteredObject::DeviceData::SP owl::InstanceGroup::createOn ( const DeviceContext::SP &  device)
override

creates the device-specific data for this group

◆ getDD()

InstanceGroup::DeviceData & owl::InstanceGroup::getDD ( const DeviceContext::SP &  device) const
inline

get reference to given device-specific data for this object

◆ getSBTOffset()

int owl::InstanceGroup::getSBTOffset ( ) const
inlineoverridevirtual

return the SBT offset to use for this group - SBT offsets for instnace groups are always 0

Implements owl::Group.

◆ refitAccel()

void owl::InstanceGroup::refitAccel ( LaunchParams::SP  launchParams = nullptr)
overridevirtual

re*fit* this accel - actual work depens on subclass

Implements owl::Group.

◆ setChild()

void owl::InstanceGroup::setChild ( size_t  childID,
Group::SP  child 
)

set given child to given group

◆ setInstanceProg()

void owl::InstanceGroup::setInstanceProg ( Module::SP  module,
const std::string &  progName 
)

set instance program to run for this IAS

◆ setMotionInstanceProg()

void owl::InstanceGroup::setMotionInstanceProg ( Module::SP  module,
const std::string &  progName 
)

set motion instance program to run for this IAS

◆ setTransform()

void owl::InstanceGroup::setTransform ( size_t  childID,
const affine3f xfm 
)

set transformation matrix of given child

◆ setTransforms()

void owl::InstanceGroup::setTransforms ( uint32_t  timeStep,
const float *  floatsForThisStimeStep,
OWLMatrixFormat  matrixFormat 
)

set transformation matrix of given child

◆ toString()

std::string owl::InstanceGroup::toString ( ) const
overridevirtual

pretty-printer, for printf-debugging

Reimplemented from owl::Group.

Member Data Documentation

◆ children

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

◆ defaultBuildFlags

constexpr unsigned int owl::InstanceGroup::defaultBuildFlags
staticconstexpr
Initial value:
=
OPTIX_BUILD_FLAG_PREFER_FAST_TRACE

◆ instanceIDs

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

◆ instanceProg

ProgramDesc owl::InstanceGroup::instanceProg
protected

the instance prog to run for this type

◆ motionInstanceProg

ProgramDesc owl::InstanceGroup::motionInstanceProg
protected

the motion instance prog to run for this type (if motion blur is enabled)

◆ numChildren

size_t owl::InstanceGroup::numChildren

number of children in this group

◆ transforms

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

◆ useInstanceProgram

bool owl::InstanceGroup::useInstanceProgram
protected

if true, we use the instance program to generate the instances

◆ visibilityMasks

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


The documentation for this struct was generated from the following file: