Skip to content

Commit e7a88bf

Browse files
num3ricremia
andauthored
Enforce GL_NEAREST with gpu tetrahedral interpolation, fixing #1676. (#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]>
1 parent 4dff29e commit e7a88bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ void GetLut3DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ConstLut3DO
3232
std::string name(resName.str());
3333
StringUtils::ReplaceInPlace(name, "__", "_");
3434

35+
Interpolation samplerInterpolation = lutData->getConcreteInterpolation();
36+
// Enforce GL_NEAREST with shader-generated tetrahedral interpolation.
37+
if (samplerInterpolation == INTERP_TETRAHEDRAL)
38+
{
39+
samplerInterpolation = INTERP_NEAREST;
40+
}
3541
// (Using CacheID here to potentially allow reuse of existing textures.)
3642
shaderCreator->add3DTexture(name.c_str(),
3743
GpuShaderText::getSamplerName(name).c_str(),
3844
lutData->getGridSize(),
39-
lutData->getConcreteInterpolation(),
45+
samplerInterpolation,
4046
&lutData->getArray()[0]);
4147

4248
{

0 commit comments

Comments
 (0)