Loading...
Searching...
No Matches
HdEmbreeRenderer Class Referencefinal

HdEmbreeRenderer implements a renderer on top of Embree's raycasting abilities. More...

#include <renderer.h>

Public Types

using WriteMutex = std::mutex
 
using ScopedLock = std::scoped_lock< WriteMutex >
 

Public Member Functions

 HdEmbreeRenderer ()
 Renderer constructor.
 
 ~HdEmbreeRenderer ()
 Renderer destructor.
 
void SetScene (RTCScene scene)
 Set the embree scene that this renderer should raycast into.
 
void SetDataWindow (const GfRect2i &dataWindow)
 Set the data window to fill (same meaning as in CameraUtilFraming with coordinate system also being y-Down).
 
void SetCamera (const GfMatrix4d &viewMatrix, const GfMatrix4d &projMatrix)
 Set the camera to use for rendering.
 
void SetAovBindings (HdRenderPassAovBindingVector const &aovBindings)
 Set the aov bindings to use for rendering.
 
void AddLight (SdfPath const &lightPath, HdEmbree_Light *light)
 Add a light.
 
void RemoveLight (SdfPath const &lightPath, HdEmbree_Light *light)
 Remove a light.
 
HdRenderPassAovBindingVector const & GetAovBindings () const
 Get the aov bindings being used for rendering.
 
void SetSamplesToConvergence (int samplesToConvergence)
 Set how many samples to render before considering an image converged.
 
void SetAmbientOcclusionSamples (int ambientOcclusionSamples)
 Set how many samples to use for ambient occlusion.
 
void SetEnableSceneColors (bool enableSceneColors)
 Sets whether to use scene colors while rendering.
 
void SetRandomNumberSeed (int randomNumberSeed)
 Sets a number to seed the random number generator with.
 
void SetEnableLighting (bool enableLighting)
 Sets whether to enable direct lighting (disables ambient occlusion).
 
void Render (HdRenderThread *renderThread)
 Rendering entrypoint: add one sample per pixel to the whole sample buffer, and then loop until the image is converged.
 
void Clear ()
 Clear the bound aov buffers (typically before rendering).
 
void MarkAovBuffersUnconverged ()
 Mark the aov buffers as unconverged.
 
int GetCompletedSamples () const
 Get the number of samples completed so far.
 

Detailed Description

HdEmbreeRenderer implements a renderer on top of Embree's raycasting abilities.

This is currently a very simple renderer. It breaks the framebuffer into tiles for multithreading; sends out jittered camera rays; and implements the following shading:

  • Colors via the "color" primvar.
  • Lighting via N dot Camera-ray, simulating a point light at the camera origin.
  • Ambient occlusion.

Definition at line 52 of file renderer.h.

Member Typedef Documentation

◆ ScopedLock

using ScopedLock = std::scoped_lock<WriteMutex>

Definition at line 56 of file renderer.h.

◆ WriteMutex

using WriteMutex = std::mutex

Definition at line 55 of file renderer.h.

Constructor & Destructor Documentation

◆ HdEmbreeRenderer()

Renderer constructor.

◆ ~HdEmbreeRenderer()

Renderer destructor.

Member Function Documentation

◆ AddLight()

void AddLight ( SdfPath const &  lightPath,
HdEmbree_Light *  light 
)

Add a light.

◆ Clear()

void Clear ( )

Clear the bound aov buffers (typically before rendering).

◆ GetAovBindings()

HdRenderPassAovBindingVector const & GetAovBindings ( ) const
inline

Get the aov bindings being used for rendering.

Returns
the current aov bindings.

Definition at line 89 of file renderer.h.

◆ GetCompletedSamples()

int GetCompletedSamples ( ) const

Get the number of samples completed so far.

◆ MarkAovBuffersUnconverged()

void MarkAovBuffersUnconverged ( )

Mark the aov buffers as unconverged.

◆ RemoveLight()

void RemoveLight ( SdfPath const &  lightPath,
HdEmbree_Light *  light 
)

Remove a light.

◆ Render()

void Render ( HdRenderThread renderThread)

Rendering entrypoint: add one sample per pixel to the whole sample buffer, and then loop until the image is converged.

After each pass, the image will be resolved into a color buffer.

Parameters
renderThreadA handle to the render thread, used for checking for cancellation and locking the color buffer.

◆ SetAmbientOcclusionSamples()

void SetAmbientOcclusionSamples ( int  ambientOcclusionSamples)

Set how many samples to use for ambient occlusion.

Parameters
ambientOcclusionSamplesHow many samples are needed for ambient occlusion? 0 = disable.

◆ SetAovBindings()

void SetAovBindings ( HdRenderPassAovBindingVector const &  aovBindings)

Set the aov bindings to use for rendering.

Parameters
aovBindingsA list of aov bindings.

◆ SetCamera()

void SetCamera ( const GfMatrix4d viewMatrix,
const GfMatrix4d projMatrix 
)

Set the camera to use for rendering.

Parameters
viewMatrixThe camera's world-to-view matrix.
projMatrixThe camera's view-to-NDC projection matrix.

◆ SetDataWindow()

void SetDataWindow ( const GfRect2i dataWindow)

Set the data window to fill (same meaning as in CameraUtilFraming with coordinate system also being y-Down).

◆ SetEnableLighting()

void SetEnableLighting ( bool  enableLighting)

Sets whether to enable direct lighting (disables ambient occlusion).

Parameters
enableLightingWhether drawing should evaluate direct lighting.

◆ SetEnableSceneColors()

void SetEnableSceneColors ( bool  enableSceneColors)

Sets whether to use scene colors while rendering.

Parameters
enableSceneColorsWhether drawing should sample color, or draw everything as white.

◆ SetRandomNumberSeed()

void SetRandomNumberSeed ( int  randomNumberSeed)

Sets a number to seed the random number generator with.

Parameters
randomNumberSeedIf -1, then the random number generator is seeded in a non-deterministic way; otherwise, it is seeded with this value.

◆ SetSamplesToConvergence()

void SetSamplesToConvergence ( int  samplesToConvergence)

Set how many samples to render before considering an image converged.

Parameters
samplesToConvergenceHow many samples are needed, per-pixel, before the image is considered finished.

◆ SetScene()

void SetScene ( RTCScene  scene)

Set the embree scene that this renderer should raycast into.

Parameters
sceneThe embree scene to use.

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