![]() |
|
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. | |
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:
Definition at line 52 of file renderer.h.
| using ScopedLock = std::scoped_lock<WriteMutex> |
Definition at line 56 of file renderer.h.
| using WriteMutex = std::mutex |
Definition at line 55 of file renderer.h.
| HdEmbreeRenderer | ( | ) |
Renderer constructor.
| ~HdEmbreeRenderer | ( | ) |
Renderer destructor.
| void AddLight | ( | SdfPath const & | lightPath, |
| HdEmbree_Light * | light | ||
| ) |
Add a light.
| void Clear | ( | ) |
Clear the bound aov buffers (typically before rendering).
|
inline |
Get the aov bindings being used for rendering.
Definition at line 89 of file renderer.h.
| int GetCompletedSamples | ( | ) | const |
Get the number of samples completed so far.
| void MarkAovBuffersUnconverged | ( | ) |
Mark the aov buffers as unconverged.
| void RemoveLight | ( | SdfPath const & | lightPath, |
| HdEmbree_Light * | light | ||
| ) |
Remove a light.
| 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.
| renderThread | A handle to the render thread, used for checking for cancellation and locking the color buffer. |
| void SetAmbientOcclusionSamples | ( | int | ambientOcclusionSamples | ) |
Set how many samples to use for ambient occlusion.
| ambientOcclusionSamples | How many samples are needed for ambient occlusion? 0 = disable. |
| void SetAovBindings | ( | HdRenderPassAovBindingVector const & | aovBindings | ) |
Set the aov bindings to use for rendering.
| aovBindings | A list of aov bindings. |
| void SetCamera | ( | const GfMatrix4d & | viewMatrix, |
| const GfMatrix4d & | projMatrix | ||
| ) |
Set the camera to use for rendering.
| viewMatrix | The camera's world-to-view matrix. |
| projMatrix | The camera's view-to-NDC projection matrix. |
| void SetDataWindow | ( | const GfRect2i & | dataWindow | ) |
Set the data window to fill (same meaning as in CameraUtilFraming with coordinate system also being y-Down).
| void SetEnableLighting | ( | bool | enableLighting | ) |
Sets whether to enable direct lighting (disables ambient occlusion).
| enableLighting | Whether drawing should evaluate direct lighting. |
| void SetEnableSceneColors | ( | bool | enableSceneColors | ) |
Sets whether to use scene colors while rendering.
| enableSceneColors | Whether drawing should sample color, or draw everything as white. |
| void SetRandomNumberSeed | ( | int | randomNumberSeed | ) |
Sets a number to seed the random number generator with.
| randomNumberSeed | If -1, then the random number generator is seeded in a non-deterministic way; otherwise, it is seeded with this value. |
| void SetSamplesToConvergence | ( | int | samplesToConvergence | ) |
Set how many samples to render before considering an image converged.
| samplesToConvergence | How many samples are needed, per-pixel, before the image is considered finished. |
| void SetScene | ( | RTCScene | scene | ) |
Set the embree scene that this renderer should raycast into.
| scene | The embree scene to use. |