Skip to content

Commit c219fcf

Browse files
committed
Merge pull request PixarAnimationStudios#3211 from pmolodo/pr/hdEmbree-random-fix-standalone
[hdEmbree] fix for random number generation (standalone) (Internal change: 2341332)
2 parents 70b526f + 67fc43f commit c219fcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pxr/imaging/plugin/hdEmbree/renderer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ HdEmbreeRenderer::_RenderTiles(HdRenderThread *renderThread,
503503

504504
// Create a uniform distribution for jitter calculations.
505505
std::uniform_real_distribution<float> uniform_dist(0.0f, 1.0f);
506-
std::function<float()> uniform_float = std::bind(uniform_dist, random);
506+
auto uniform_float = [&random, &uniform_dist]() { return uniform_dist(random); };
507507

508508
// _RenderTiles gets a range of tiles; iterate through them.
509509
for (unsigned int tile = tileStart; tile < tileEnd; ++tile) {
@@ -923,7 +923,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position,
923923
{
924924
// Create a uniform random distribution for AO calculations.
925925
std::uniform_real_distribution<float> uniform_dist(0.0f, 1.0f);
926-
std::function<float()> uniform_float = std::bind(uniform_dist, random);
926+
auto uniform_float = [&random, &uniform_dist]() { return uniform_dist(random); };
927927

928928
// 0 ambient occlusion samples means disable the ambient occlusion term.
929929
if (_ambientOcclusionSamples < 1) {

0 commit comments

Comments
 (0)