HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT > Class Template Reference

A (very) simple multithreaded ray tracer specifically for narrow-band level sets. More...

#include <RayTracer.h>

Public Types

using GridType = GridT
 
using Vec3Type = typename IntersectorT::Vec3Type
 
using RayType = typename IntersectorT::RayType
 

Public Member Functions

 LevelSetRayTracer (const GridT &grid, const BaseShader &shader, BaseCamera &camera, size_t pixelSamples=1, unsigned int seed=0)
 Constructor based on an instance of the grid to be rendered. More...
 
 LevelSetRayTracer (const IntersectorT &inter, const BaseShader &shader, BaseCamera &camera, size_t pixelSamples=1, unsigned int seed=0)
 Constructor based on an instance of the intersector performing the ray-intersections. More...
 
 LevelSetRayTracer (const LevelSetRayTracer &other)
 Copy constructor. More...
 
 ~LevelSetRayTracer ()
 Destructor. More...
 
void setGrid (const GridT &grid)
 Set the level set grid to be ray-traced. More...
 
void setIntersector (const IntersectorT &inter)
 Set the intersector that performs the actual intersection of the rays against the narrow-band level set. More...
 
void setShader (const BaseShader &shader)
 Set the shader derived from the abstract BaseShader class. More...
 
void setCamera (BaseCamera &camera)
 Set the camera derived from the abstract BaseCamera class. More...
 
void setPixelSamples (size_t pixelSamples, unsigned int seed=0)
 Set the number of pixel samples and the seed for jittered sub-rays. A value larger than one implies anti-aliasing by jittered super-sampling. More...
 
void render (bool threaded=true) const
 Perform the actual (potentially multithreaded) ray-tracing. More...
 
void operator() (const tbb::blocked_range< size_t > &range) const
 Public method required by tbb::parallel_for. More...
 

Detailed Description

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>
class openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >

A (very) simple multithreaded ray tracer specifically for narrow-band level sets.

Included primarily as a reference implementation.

Definition at line 103 of file RayTracer.h.

Member Typedef Documentation

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::GridType = GridT

Definition at line 106 of file RayTracer.h.

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::RayType = typename IntersectorT::RayType

Definition at line 108 of file RayTracer.h.

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::Vec3Type = typename IntersectorT::Vec3Type

Definition at line 107 of file RayTracer.h.

Constructor & Destructor Documentation

template<typename GridT , typename IntersectorT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::LevelSetRayTracer ( const GridT &  grid,
const BaseShader shader,
BaseCamera camera,
size_t  pixelSamples = 1,
unsigned int  seed = 0 
)
inline

Constructor based on an instance of the grid to be rendered.

Definition at line 834 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::LevelSetRayTracer ( const IntersectorT &  inter,
const BaseShader shader,
BaseCamera camera,
size_t  pixelSamples = 1,
unsigned int  seed = 0 
)
inline

Constructor based on an instance of the intersector performing the ray-intersections.

Definition at line 850 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::LevelSetRayTracer ( const LevelSetRayTracer< GridT, IntersectorT > &  other)
inline

Copy constructor.

Definition at line 866 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::~LevelSetRayTracer ( )
inline

Destructor.

Definition at line 878 of file RayTracer.h.

Member Function Documentation

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::operator() ( const tbb::blocked_range< size_t > &  range) const
inline

Public method required by tbb::parallel_for.

Warning
Never call it directly.

Definition at line 944 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::render ( bool  threaded = true) const
inline

Perform the actual (potentially multithreaded) ray-tracing.

Definition at line 936 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::setCamera ( BaseCamera camera)
inline

Set the camera derived from the abstract BaseCamera class.

Definition at line 909 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::setGrid ( const GridT &  grid)
inline

Set the level set grid to be ray-traced.

Definition at line 885 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::setIntersector ( const IntersectorT &  inter)
inline

Set the intersector that performs the actual intersection of the rays against the narrow-band level set.

Definition at line 893 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::setPixelSamples ( size_t  pixelSamples,
unsigned int  seed = 0 
)
inline

Set the number of pixel samples and the seed for jittered sub-rays. A value larger than one implies anti-aliasing by jittered super-sampling.

Exceptions
ValueErrorif pixelSamples is equal to zero.

Definition at line 917 of file RayTracer.h.

template<typename GridT , typename IntersectorT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayTracer< GridT, IntersectorT >::setShader ( const BaseShader shader)
inline

Set the shader derived from the abstract BaseShader class.

Note
The shader is not assumed to be thread-safe so each thread will get its only deep copy. For instance it could contains a ValueAccessor into another grid with auxiliary shading information. Thus, make sure it is relatively light-weight and efficient to copy (which is the case for ValueAccesors).

Definition at line 901 of file RayTracer.h.


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