Skip to content

Commit

Permalink
[vsp] Adding VSP support to the ImageSpaceGuidingBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
sherholz-intel committed Dec 3, 2024
1 parent 059640b commit 86be4ac
Show file tree
Hide file tree
Showing 6 changed files with 563 additions and 89 deletions.
14 changes: 11 additions & 3 deletions openpgl/api/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,9 @@ extern "C" OPENPGL_DLLEXPORT void pglReleaseString(PGLString str)
// ImageSpaceGuidingBuffer ///////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

extern "C" OPENPGL_DLLEXPORT PGLImageSpaceGuidingBuffer pglFieldNewImageSpaceGuidingBuffer(const pgl_point2i resolution)
extern "C" OPENPGL_DLLEXPORT PGLImageSpaceGuidingBuffer pglFieldNewImageSpaceGuidingBuffer(const PGLImageSpaceGuidingBufferConfig cfg)
{
return (PGLImageSpaceGuidingBuffer) new openpgl::ImageSpaceGuidingBuffer(resolution, false);
return (PGLImageSpaceGuidingBuffer) new openpgl::ImageSpaceGuidingBuffer(cfg);
}

extern "C" OPENPGL_DLLEXPORT PGLImageSpaceGuidingBuffer pglFieldNewImageSpaceGuidingBufferFromFile(const char *fileName)
Expand Down Expand Up @@ -917,12 +917,20 @@ extern "C" OPENPGL_DLLEXPORT void pglImageSpaceGuidingBufferStore(PGLImageSpaceG
gImageSpaceGuidingBuffer->store(fileName);
}

extern "C" OPENPGL_DLLEXPORT pgl_vec3f pglImageSpaceGuidingBufferGetPixelContributionEstimate(PGLImageSpaceGuidingBuffer imageSpaceGuidingBuffer, const pgl_point2i pixel)
extern "C" OPENPGL_DLLEXPORT pgl_vec3f pglImageSpaceGuidingBufferGetContributionEstimate(PGLImageSpaceGuidingBuffer imageSpaceGuidingBuffer, const pgl_point2i pixel)
{
auto *gImageSpaceGuidingBuffer = (openpgl::ImageSpaceGuidingBuffer *)imageSpaceGuidingBuffer;
return gImageSpaceGuidingBuffer->getContributionEstimate(pixel);
}

#if defined(OPENPGL_VSP_GUIDING)
extern "C" OPENPGL_DLLEXPORT float pglImageSpaceGuidingBufferGetVolumeScatterProbabilityEstimate(PGLImageSpaceGuidingBuffer imageSpaceGuidingBuffer, const pgl_point2i pixel)
{
auto *gImageSpaceGuidingBuffer = (openpgl::ImageSpaceGuidingBuffer *)imageSpaceGuidingBuffer;
return gImageSpaceGuidingBuffer->getVolumeScatterProbabilityEstimate(pixel);
}
#endif

extern "C" OPENPGL_DLLEXPORT bool pglImageSpaceGuidingBufferIsReady(PGLImageSpaceGuidingBuffer imageSpaceGuidingBuffer)
{
auto *gImageSpaceGuidingBuffer = (openpgl::ImageSpaceGuidingBuffer *)imageSpaceGuidingBuffer;
Expand Down
Loading

0 comments on commit 86be4ac

Please sign in to comment.