Skip to content

Commit 82001c5

Browse files
committed
fix: Update ImageMapper change to only affect case with 3 dependent components
1 parent 6f34aa5 commit 82001c5

File tree

1 file changed

+13
-1
lines changed
  • Sources/Rendering/OpenGL/ImageMapper

1 file changed

+13
-1
lines changed

Sources/Rendering/OpenGL/ImageMapper/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function vtkOpenGLImageMapper(publicAPI, model) {
295295
]
296296
).result;
297297
break;
298-
default:
298+
case 3:
299299
FSSource = vtkShaderProgram.substitute(
300300
FSSource,
301301
'//VTK::TCoord::Impl',
@@ -306,6 +306,18 @@ function vtkOpenGLImageMapper(publicAPI, model) {
306306
' texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, opacity);',
307307
]
308308
).result;
309+
break;
310+
default:
311+
FSSource = vtkShaderProgram.substitute(
312+
FSSource,
313+
'//VTK::TCoord::Impl',
314+
[
315+
'vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;',
316+
'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,',
317+
' texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,',
318+
' texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, tcolor.a);',
319+
]
320+
).result;
309321
}
310322
}
311323

0 commit comments

Comments
 (0)