Loading...
Searching...
No Matches
LevelSetRayTracer< GridT, IntersectorT > Class Template Reference

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

`#include <openvdb/tools/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.
| 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.
| LevelSetRayTracer (const LevelSetRayTracer &other)
| Copy constructor.
| ~LevelSetRayTracer ()
| Destructor.
void | setGrid (const GridT &grid)
| Set the level set grid to be ray-traced.
void | setIntersector (const IntersectorT &inter)
| Set the intersector that performs the actual intersection of the rays against the narrow-band level set.
void | setShader (const BaseShader &shader)
| Set the shader derived from the abstract BaseShader class.
void | setCamera (BaseCamera &camera)
| Set the camera derived from the abstract BaseCamera class.
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.
void | render (bool threaded=true) const
| Perform the actual (potentially multithreaded) ray-tracing.
void | operator() (const tbb::blocked_range< size_t > &range) const
| Public method required by tbb::parallel_for.

## Detailed Description

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

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

Included primarily as a reference implementation.

## Member Typedef Documentation

## GridType

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>

using GridType = GridT

## RayType

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>

using RayType = typename IntersectorT::RayType

## Vec3Type

template<typename GridT, typename IntersectorT = tools::LevelSetRayIntersector<GridT>>

using Vec3Type = typename IntersectorT::Vec3Type

## Constructor & Destructor Documentation

## LevelSetRayTracer() [1/3]

template<typename GridT, typename 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.

## LevelSetRayTracer() [2/3]

template<typename GridT, typename 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.

## LevelSetRayTracer() [3/3]

template<typename GridT, typename IntersectorT>

LevelSetRayTracer | ( | const LevelSetRayTracer< GridT, IntersectorT > & | other | ) |

inline

Copy constructor.

## ~LevelSetRayTracer()

template<typename GridT, typename IntersectorT>

~LevelSetRayTracer | ( |  | ) |

inline

Destructor.

## Member Function Documentation

## operator()()

template<typename GridT, typename IntersectorT>

void operator() | ( | const tbb::blocked_range< size_t > & | range | ) | const

inline

Public method required by tbb::parallel_for.

Warning
  Never call it directly.

## render()

template<typename GridT, typename IntersectorT>

void render | ( | bool | threaded = true | ) | const

inline

Perform the actual (potentially multithreaded) ray-tracing.

## setCamera()

template<typename GridT, typename IntersectorT>

void setCamera | ( | BaseCamera & | camera | ) |

inline

Set the camera derived from the abstract BaseCamera class.

## setGrid()

template<typename GridT, typename IntersectorT>

void setGrid | ( | const GridT & | grid | ) |

inline

Set the level set grid to be ray-traced.

## setIntersector()

template<typename GridT, typename IntersectorT>

void setIntersector | ( | const IntersectorT & | inter | ) |

inline

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

## setPixelSamples()

template<typename GridT, typename IntersectorT>

void 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

  ValueError | if pixelSamples is equal to zero.

## setShader()

template<typename GridT, typename IntersectorT>

void 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).