Skip to content

Commit

Permalink
Enforce GL_NEAREST with gpu tetrahedral interpolation, fixing #1676. (#…
Browse files Browse the repository at this point in the history
…1708)

Signed-off-by: Eric Renaud-Houde <[email protected]>

Signed-off-by: Eric Renaud-Houde <[email protected]>
Co-authored-by: Rémi Achard <[email protected]>
  • Loading branch information
num3ric and remia authored Oct 30, 2022
1 parent 4dff29e commit e7a88bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ void GetLut3DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ConstLut3DO
std::string name(resName.str());
StringUtils::ReplaceInPlace(name, "__", "_");

Interpolation samplerInterpolation = lutData->getConcreteInterpolation();
// Enforce GL_NEAREST with shader-generated tetrahedral interpolation.
if (samplerInterpolation == INTERP_TETRAHEDRAL)
{
samplerInterpolation = INTERP_NEAREST;
}
// (Using CacheID here to potentially allow reuse of existing textures.)
shaderCreator->add3DTexture(name.c_str(),
GpuShaderText::getSamplerName(name).c_str(),
lutData->getGridSize(),
lutData->getConcreteInterpolation(),
samplerInterpolation,
&lutData->getArray()[0]);

{
Expand Down

0 comments on commit e7a88bf

Please sign in to comment.