HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RAY_ProcGT Class Reference

Procedural to render a single GT primitive. More...

#include <RAY_ProcGT.h>

+ Inheritance diagram for RAY_ProcGT:

Classes

class  StylingContext
 

Public Types

using StylerInfoArray = StylingContext::StylerInfoArray
 
using SharedPrimGroup = StylingContext::SharedPrimGroup
 
using GroupSharingMap = StylingContext::GroupSharingMap
 

Public Member Functions

 RAY_ProcGT (const GT_PrimitiveHandle &prim, bool use_multi_segments=true, fpreal shutter_close=-1)
 
 RAY_ProcGT (const UT_Array< GT_PrimitiveHandle > &primitives, fpreal shutter_close=-1)
 
 ~RAY_ProcGT () override
 
void dump (bool dump_full_geo=false)
 
void instanceVelocityBlur (const GT_DataArrayHandle &v, const GT_DataArrayHandle &w, const GT_DataArrayHandle &a, const GT_DataArrayHandle &pivot)
 
int velocityBlur () const
 
void setTopLevel (bool v)
 
const char * className () const override
 
int initialize (const UT_BoundingBox *box) override
 
void getBoundingBox (UT_BoundingBox &box) override
 
void render () override
 
bool canGenerateInstancedGeometry () const override
 
- Public Member Functions inherited from RAY_Procedural
 RAY_Procedural ()
 
virtual ~RAY_Procedural ()
 
virtual bool isEqual (const RAY_Procedural *) const
 
int lookupParmToken (const char *name) const
 
RAY_ProceduralGeo createGeometry () const
 Allocate geometry for this procedural. More...
 
const int64getIParm (int token, size_t &size) const
 
const fpreal64getFParm (int token, size_t &size) const
 
const UT_StringHoldergetSParm (int token, size_t &size) const
 
const int64getIParm (const char *name, size_t &size) const
 
const fpreal64getFParm (const char *name, size_t &size) const
 
const UT_StringHoldergetSParm (const char *name, size_t &size) const
 
bool import (const char *name, int32 *value, int vectorsize) const
 
bool import (const char *name, int64 *value, int vectorsize) const
 
bool import (const char *name, fpreal32 *value, int vectorsize) const
 
bool import (const char *name, fpreal64 *value, int vectorsize) const
 
bool import (const char *name, UT_String &result, int idx=0) const
 
bool import (const char *name, UT_StringHolder &result, int idx=0) const
 
bool import (RAY_Handle handle, const char *name, int32 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, int64 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, fpreal32 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, fpreal64 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, UT_String &result, int idx=0) const
 
bool import (RAY_Handle handle, const char *name, UT_StringHolder &result, int idx=0) const
 
bool importAll (RAY_Handle handle, UT_Options &settings, bool local_only=false) const
 
RAY_ROProceduralGeo createGeometry (GU_DetailHandle &gdh) const
 
RAY_ROProceduralGeo createGeometry (GU_ConstDetailHandle &gdh) const
 
RAY_ROProceduralGeo createGeometry (const GU_DetailHandle *gdh, int nsegments, const fpreal *shutter_times=nullptr) const
 
RAY_ROProceduralGeo createGeometry (const GU_ConstDetailHandle *gdh, int nsegments, const fpreal *shutter_times=nullptr) const
 
RAY_ProceduralData * data ()
 

Static Public Member Functions

static const GT_RefineParmsmantraRefineParms (const RAY_Procedural &proc)
 
- Static Public Member Functions inherited from RAY_Procedural
static void optimizeGeometry (GU_Detail &gdp, bool create_normals_if_needed)
 
static void optimizeGeometry (GU_DetailHandle &gdp, bool create_normals_if_needed)
 
void setInstanceTransform (const RAY_ProceduralChildPtr &kid, const GT_TransformHandle &xform) const
 
void processInstanceAttributes (const RAY_ProceduralChildPtr &kid, const GT_AttributeListHandle &attrib, exint idx) const
 
void velocityBlurTransform (const RAY_ProceduralChildPtr &kid, const GT_TransformArrayHandle &xforms, const GT_DataArrayHandle &v, const GT_DataArrayHandle &w, const GT_DataArrayHandle &accel, const GT_DataArrayHandle &pivot, const GT_TransformHandle &packed, exint xform) const
 
void renderPrim (const GT_PrimitiveHandle &prim, StylingContext &styling) const
 

Additional Inherited Members

- Protected Member Functions inherited from RAY_Procedural
const GA_AttributequeryGeometrySegment (const GA_Attribute *attr, int seg) const
 
void clearGeometrySegments (GA_Attribute *attr)
 
fpreal getLevelOfDetail (const UT_BoundingBox &box) const
 
RAY_ProceduralChildPtr createChild () const
 
void openGeometryObject ()
 
void addGeometry (GU_Detail *gdp, fpreal shutter)
 
int openProceduralObject ()
 Open a procedural object. More...
 
void addProcedural (RAY_Procedural *proc)
 
int addProcedural (int argc, char *argv[], const UT_BoundingBox *box=0)
 
void openVolumeObject ()
 Open a volume object. More...
 
void addVolume (VGEO_Volume *volume, fpreal shutter)
 
void setPreTransform (const UT_Matrix4D &transform, fpreal shutter)
 
void setTransform (const UT_Matrix4D &transform, fpreal shutter)
 
void setStylerInfo (const RAY_StylerInfo &styler_info)
 
bool setShopMaterialPath (const char *shop_materialpath, const char *material_override=nullptr, const char *property_map=nullptr)
 
void debugSettings (const char *style="object") const
 Print out the object's settings to stderr. More...
 
void processPrimitiveMaterial (const GEO_Primitive *prim)
 
void closeObject ()
 
bool parseMaterialIFD (const char *filename)
 
int queryWorldTransformSamples () const
 Query the number of transform samples for the world. More...
 
UT_Matrix4D queryWorldTransform (int sample) const
 Get the world transform. More...
 
RAY_ObjectHandle queryObject (const char *name) const
 
RAY_MaterialHandle queryMaterial (const char *name) const
 
RAY_LightHandle queryLight (const char *name) const
 
int queryTransformSamples (RAY_Handle handle) const
 
UT_Matrix4D queryTransform (RAY_Handle handle, int sample) const
 
const UT_Matrix4DqueryShaderTransform (RAY_ObjectHandle handle, int sample) const
 
const STY_StylerqueryStyler (RAY_ObjectHandle handle) const
 
const char * queryName (RAY_Handle handle) const
 
const char * queryRootName () const
 Get the name of the object which owns this procedural. More...
 
int queryGeometrySamples (RAY_ObjectHandle handle) const
 
RAY_ROProceduralGeo queryGeometry (RAY_ObjectHandle handle) const
 
bool changeSetting (const char *name, const char *value, const char *style="object")
 
bool changeSetting (const char *name, int argc, const char *const *argv, const char *style="object")
 
bool changeSetting (const char *name, int argc, const int *argv, const char *style="object")
 
bool changeSetting (const char *name, int argc, const fpreal *argv, const char *style="object")
 
bool declareSetting (const char *name, const char *value)
 
bool declareSetting (const char *name, int argc, const char *const *argv)
 
bool declareSetting (const char *name, int argc, const int *argv)
 
bool declareSetting (const char *name, int argc, const fpreal *argv)
 
- Static Protected Member Functions inherited from RAY_Procedural
static void lookupPrimitiveMaterialAttributes (const GEO_Detail &geo, RAY_PrimitiveMaterialAttributes &attribs)
 

Detailed Description

Procedural to render a single GT primitive.

When rendering GT primitives, they will be refined until they hit geometry that Mantra can handle.

When GT_PRIM_INSTANCE primitives are encountered, the procedural will create multiple instance objects in mantra, allowing the geometry to be shared between instances automatically. In addition, the following uniform/detail attributes are handled on the instance primitives:

  • shop_materialpath
    Assign a material for the instance. This calls RAY_Procedural::setShopMaterialPath(). If the shop_materialpath is found, then additional attributes (material_override and property_override) are evaluated to handle shader argument and property overrides.

lightcategories
Set the lightcategories property on the instance

  • lightmask
    Set the lightmask property on the instance. Note that this may not handle light instancing properly.
  • categories
    Set the categories for instance.
Examples:
RAY/RAY_DemoGT.C.

Definition at line 48 of file RAY_ProcGT.h.

Member Typedef Documentation

Constructor & Destructor Documentation

RAY_ProcGT::RAY_ProcGT ( const GT_PrimitiveHandle prim,
bool  use_multi_segments = true,
fpreal  shutter_close = -1 
)

A mantra procedural to render a GT primitive. If the GT primitive has multiple segments, the primitive will be rendered with deformation motion blur unless use_multi_segments is false.

When multi-segment blur is active, the shutter_close can be specified. If the shutter_close is less than 0, the value will be imported from the camera:shutter setting. If shutter_close is 0, multi-segment blur will be disabled.

If the GT primitive has the proper sub-frame sampling time, then you likely want to set the shutter_close to 1.0.

RAY_ProcGT::RAY_ProcGT ( const UT_Array< GT_PrimitiveHandle > &  primitives,
fpreal  shutter_close = -1 
)

Alternatively, motion segments can be specified using an array of primitives.

RAY_ProcGT::~RAY_ProcGT ( )
override

Member Function Documentation

bool RAY_ProcGT::canGenerateInstancedGeometry ( ) const
overridevirtual

Methods from RAY_Procedural

Reimplemented from RAY_Procedural.

const char* RAY_ProcGT::className ( ) const
overridevirtual

Methods from RAY_Procedural

Implements RAY_Procedural.

void RAY_ProcGT::dump ( bool  dump_full_geo = false)
void RAY_ProcGT::getBoundingBox ( UT_BoundingBox box)
overridevirtual

Methods from RAY_Procedural

Implements RAY_Procedural.

int RAY_ProcGT::initialize ( const UT_BoundingBox box)
overridevirtual

Methods from RAY_Procedural

Implements RAY_Procedural.

void RAY_ProcGT::instanceVelocityBlur ( const GT_DataArrayHandle v,
const GT_DataArrayHandle w,
const GT_DataArrayHandle a,
const GT_DataArrayHandle pivot 
)
static const GT_RefineParms* RAY_ProcGT::mantraRefineParms ( const RAY_Procedural proc)
static
void RAY_ProcGT::processInstanceAttributes ( const RAY_ProceduralChildPtr kid,
const GT_AttributeListHandle attrib,
exint  idx 
) const

Create a new styler for each instance in a child ProcGT based on our existing instance stylers and any new instance defined in the prim.

void RAY_ProcGT::render ( )
overridevirtual

Methods from RAY_Procedural

Implements RAY_Procedural.

void RAY_ProcGT::renderPrim ( const GT_PrimitiveHandle prim,
StylingContext styling 
) const

Create a new styler for each instance in a child ProcGT based on our existing instance stylers and any new instance defined in the prim.

void RAY_ProcGT::setInstanceTransform ( const RAY_ProceduralChildPtr kid,
const GT_TransformHandle xform 
) const

Create a new styler for each instance in a child ProcGT based on our existing instance stylers and any new instance defined in the prim.

void RAY_ProcGT::setTopLevel ( bool  v)
inline

Definition at line 143 of file RAY_ProcGT.h.

int RAY_ProcGT::velocityBlur ( ) const
inline

Definition at line 116 of file RAY_ProcGT.h.

void RAY_ProcGT::velocityBlurTransform ( const RAY_ProceduralChildPtr kid,
const GT_TransformArrayHandle xforms,
const GT_DataArrayHandle v,
const GT_DataArrayHandle w,
const GT_DataArrayHandle accel,
const GT_DataArrayHandle pivot,
const GT_TransformHandle packed,
exint  xform 
) const

Create a new styler for each instance in a child ProcGT based on our existing instance stylers and any new instance defined in the prim.


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