HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GPUTrace Class Referenceabstract

#include <GT_GPUTrace.h>

Classes

struct  AttribInfo
 
struct  AttributeBakeRequest
 
struct  BakingOptions
 
struct  Factory
 
struct  MeshData
 
struct  PrimitiveInfo
 
struct  TraceSet
 

Public Types

enum  PrimHandleType { PHT_GT, PHT_GU }
 
enum  GT_TraceDirectionMode { GTDM_Forward, GTDM_Backward, GTDM_Both }
 
enum  DataType {
  DT_Int = 0, DT_Float, DT_Vec2, DT_Vec3,
  DT_Vec4, DT_NumDataType
}
 
enum  BakingCalcTypes {
  BCT_Ao, BCT_Cv, BCT_Cu_N, BCT_Cu_P,
  BCT_Th, BCT_Eg, BCT_Rn, BakingCalcType_Num
}
 
using GT_GPUTracePtr = UT_UniquePtr< GT_GPUTrace >
 

Public Member Functions

 GT_GPUTrace (const Factory &factory)
 
virtual ~GT_GPUTrace ()
 
const UT_StringHoldername () const
 
const UT_StringHolderlabel () const
 
virtual void computeBaking (exint nrays, UT_Vector3 *org, UT_Vector3 *dir, const float *tfar, const BakingOptions &opts, bool trace_high_res, UT_Array< AttributeBakeRequest > &requests, const UT_StringHolder *bakemesh_tracesets, const UT_Vector3 *tanu=nullptr, const UT_Vector3 *tanv=nullptr, float *ao=nullptr, float *cavity=nullptr, float *curvature=nullptr, float *thickness=nullptr, float *edge=nullptr, UT_Vector3 *rn=nullptr) const =0
 
bool init (const UT_Array< PrimitiveInfo > &prims, const BakingOptions &opts)
 

Static Public Member Functions

static void registerFactory (UT_UniquePtr< Factory > factory)
 
static void removeFactory (const UT_StringRef &name)
 
static void getFactories (UT_Array< const Factory * > &factories)
 
static GT_GPUTracePtr allocTrace (const UT_StringRef &name)
 Allocate a tracer from a particular factory. More...
 
static float vop_bias (float base, float bias)
 
static GT_GPUTracePtr allocTrace (const UT_Array< PrimitiveInfo > &prims, const UT_StringRef &name, const BakingOptions &opts)
 

Static Public Attributes

static constexpr uint AO_SEED = 0x4c41e0cd
 
static constexpr uint CV_SEED = 0xf2ee2275
 
static constexpr uint CU_N_SEED = 0x4b65c61e
 
static constexpr uint CU_P_SEED = 0x9a4bf788
 
static constexpr uint TH_SEED = 0x4c910506
 
static constexpr uint EG_SEED = 0x139fa345
 
static constexpr uint RN_SEED = 0xe4df7f01
 
static constexpr uint PIXEL_SEED = 0x73aecd3d
 

Protected Member Functions

virtual bool doInit (const UT_Array< PrimitiveInfo > &prims, const BakingOptions &opts)=0
 
const TraceSetbakeMeshTraceSet (const UT_StringHolder &name) const
 
const TraceSetgetTheAllTraceset () const
 
void buildTracesets (UT_Array< MeshData * > &meshes, bool selfset)
 
bool leftHanddedMesh (const GT_PrimPolygonMesh *pmesh) const
 
const fpreal32normals (const GT_PrimPolygonMesh *pmesh, GT_DataArrayHandle &handle, exint &count, GT_Owner &owner) const
 
void getAttribute (const UT_StringHolder &name, const GT_PrimPolygonMesh *pmesh, AttribInfo &attrinfo) const
 

Protected Attributes

UT_StringMap< UT_Set< int > > myTracesetNameToMeshes
 
UT_Map< UT_Set< int >, TraceSetmyMeshSetToTraceSet
 

Detailed Description

Definition at line 28 of file GT_GPUTrace.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
BCT_Ao 
BCT_Cv 
BCT_Cu_N 
BCT_Cu_P 
BCT_Th 
BCT_Eg 
BCT_Rn 
BakingCalcType_Num 

Definition at line 245 of file GT_GPUTrace.h.

Enumerator
DT_Int 
DT_Float 
DT_Vec2 
DT_Vec3 
DT_Vec4 
DT_NumDataType 

Definition at line 224 of file GT_GPUTrace.h.

Enumerator
GTDM_Forward 
GTDM_Backward 
GTDM_Both 

Definition at line 92 of file GT_GPUTrace.h.

Enumerator
PHT_GT 
PHT_GU 

Definition at line 56 of file GT_GPUTrace.h.

Constructor & Destructor Documentation

GT_GPUTrace::GT_GPUTrace ( const Factory factory)
inline

Definition at line 213 of file GT_GPUTrace.h.

virtual GT_GPUTrace::~GT_GPUTrace ( )
inlinevirtual

Definition at line 217 of file GT_GPUTrace.h.

Member Function Documentation

static GT_GPUTracePtr GT_GPUTrace::allocTrace ( const UT_StringRef name)
static

Allocate a tracer from a particular factory.

static GT_GPUTracePtr GT_GPUTrace::allocTrace ( const UT_Array< PrimitiveInfo > &  prims,
const UT_StringRef name,
const BakingOptions opts 
)
static

Allocate the best tracer for a given piece of geometry

const TraceSet* GT_GPUTrace::bakeMeshTraceSet ( const UT_StringHolder name) const
protected
void GT_GPUTrace::buildTracesets ( UT_Array< MeshData * > &  meshes,
bool  selfset 
)
protected
virtual void GT_GPUTrace::computeBaking ( exint  nrays,
UT_Vector3 org,
UT_Vector3 dir,
const float tfar,
const BakingOptions opts,
bool  trace_high_res,
UT_Array< AttributeBakeRequest > &  requests,
const UT_StringHolder bakemesh_tracesets,
const UT_Vector3 tanu = nullptr,
const UT_Vector3 tanv = nullptr,
float ao = nullptr,
float cavity = nullptr,
float curvature = nullptr,
float thickness = nullptr,
float edge = nullptr,
UT_Vector3 rn = nullptr 
) const
pure virtual

Note the dir vectors must be normalized. If trace_high_res is true, High res mesh info are traced using rays with given org and dir, typically on the Low res mesh, and, if opts.myPixelSamples also is 1, the input org and dir are so modified by the results with dir being the surface normal. tanu and tanv are tangent vectors on Low res mesh that correspond to each pixel. They are used to jitter the org. Both vectors can be passed null if opts.myPixelSamples is 1.

virtual bool GT_GPUTrace::doInit ( const UT_Array< PrimitiveInfo > &  prims,
const BakingOptions opts 
)
protectedpure virtual
void GT_GPUTrace::getAttribute ( const UT_StringHolder name,
const GT_PrimPolygonMesh pmesh,
AttribInfo attrinfo 
) const
protected
static void GT_GPUTrace::getFactories ( UT_Array< const Factory * > &  factories)
static
const TraceSet& GT_GPUTrace::getTheAllTraceset ( ) const
protected
bool GT_GPUTrace::init ( const UT_Array< PrimitiveInfo > &  prims,
const BakingOptions opts 
)

When init fails

const UT_StringHolder& GT_GPUTrace::label ( ) const
inline

Definition at line 222 of file GT_GPUTrace.h.

bool GT_GPUTrace::leftHanddedMesh ( const GT_PrimPolygonMesh pmesh) const
protected
const UT_StringHolder& GT_GPUTrace::name ( ) const
inline

Definition at line 221 of file GT_GPUTrace.h.

const fpreal32* GT_GPUTrace::normals ( const GT_PrimPolygonMesh pmesh,
GT_DataArrayHandle handle,
exint count,
GT_Owner owner 
) const
protected
static void GT_GPUTrace::registerFactory ( UT_UniquePtr< Factory factory)
static
static void GT_GPUTrace::removeFactory ( const UT_StringRef name)
static
static float GT_GPUTrace::vop_bias ( float  base,
float  bias 
)
inlinestatic

Definition at line 299 of file GT_GPUTrace.h.

Member Data Documentation

constexpr uint GT_GPUTrace::AO_SEED = 0x4c41e0cd
static

Definition at line 259 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::CU_N_SEED = 0x4b65c61e
static

Definition at line 261 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::CU_P_SEED = 0x9a4bf788
static

Definition at line 262 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::CV_SEED = 0xf2ee2275
static

Definition at line 260 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::EG_SEED = 0x139fa345
static

Definition at line 264 of file GT_GPUTrace.h.

UT_Map<UT_Set<int>, TraceSet> GT_GPUTrace::myMeshSetToTraceSet
protected

Definition at line 384 of file GT_GPUTrace.h.

UT_StringMap<UT_Set<int> > GT_GPUTrace::myTracesetNameToMeshes
protected

Definition at line 381 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::PIXEL_SEED = 0x73aecd3d
static

Definition at line 266 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::RN_SEED = 0xe4df7f01
static

Definition at line 265 of file GT_GPUTrace.h.

constexpr uint GT_GPUTrace::TH_SEED = 0x4c910506
static

Definition at line 263 of file GT_GPUTrace.h.


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