7#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_RENDERER_H
8#define PXR_IMAGING_PLUGIN_HD_EMBREE_RENDERER_H
12#include "pxr/imaging/hd/renderThread.h"
13#include "pxr/imaging/hd/renderPassState.h"
18#include <embree3/rtcore.h>
19#include <embree3/rtcore_ray.h>
24PXR_NAMESPACE_OPEN_SCOPE
109 bool _ValidateAovBindings();
119 size_t tileStart,
size_t tileEnd);
123 void _TraceRay(
unsigned int x,
unsigned int y,
125 std::default_random_engine &random);
128 GfVec4f _ComputeColor(RTCRayHit
const& rayHit,
129 std::default_random_engine &random,
132 bool _ComputeDepth(RTCRayHit
const& rayHit,
float *depth,
bool clip);
134 bool _ComputeId(RTCRayHit
const& rayHit,
TfToken const& idType, int32_t *
id);
136 bool _ComputeNormal(RTCRayHit
const& rayHit,
GfVec3f *normal,
bool eye);
138 bool _ComputePrimvar(RTCRayHit
const& rayHit,
TfToken const& primvar,
147 float _ComputeAmbientOcclusion(
GfVec3f const& position,
149 std::default_random_engine &random);
152 HdRenderPassAovBindingVector _aovBindings;
154 HdParsedAovTokenVector _aovNames;
157 bool _aovBindingsNeedValidation;
159 bool _aovBindingsValid;
167 unsigned int _height;
182 int _samplesToConvergence;
184 int _ambientOcclusionSamples;
186 bool _enableSceneColors;
189 std::atomic<int> _completedSamples;
192PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of double elements.
A 2D rectangle with integer coordinates.
Basic type for a vector of 3 float components.
Basic type for a vector of 4 float components.
HdEmbreeRenderer implements a renderer on top of Embree's raycasting abilities.
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 Render(HdRenderThread *renderThread)
Rendering entrypoint: add one sample per pixel to the whole sample buffer, and then loop until the im...
HdEmbreeRenderer()
Renderer constructor.
~HdEmbreeRenderer()
Renderer destructor.
void MarkAovBuffersUnconverged()
Mark the aov buffers as unconverged.
void SetAovBindings(HdRenderPassAovBindingVector const &aovBindings)
Set the aov bindings to use for rendering.
int GetCompletedSamples() const
Get the number of samples completed so far.
void SetScene(RTCScene scene)
Set the embree scene that this renderer should raycast into.
void SetCamera(const GfMatrix4d &viewMatrix, const GfMatrix4d &projMatrix)
Set the camera to use for rendering.
void Clear()
Clear the bound aov buffers (typically before rendering).
void SetDataWindow(const GfRect2i &dataWindow)
Set the data window to fill (same meaning as in CameraUtilFraming with coordinate system also being y...
HdRenderPassAovBindingVector const & GetAovBindings() const
Get the aov bindings being used for rendering.
HdRenderThread is a utility that specific render delegates can choose to use depending on their needs...
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...