Skip to content

Commit b2ae5a0

Browse files
authored
Merge pull request #2480 from swederik/fix/imageMapper-RGB-opacity
fix: Address incorrect opacity values when displaying RGB images in ImageMapper
2 parents 517ac80 + 8fad6bf commit b2ae5a0

File tree

1 file changed

+12
-0
lines changed
  • Sources/Rendering/OpenGL/ImageMapper

1 file changed

+12
-0
lines changed

Sources/Rendering/OpenGL/ImageMapper/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,18 @@ function vtkOpenGLImageMapper(publicAPI, model) {
295295
]
296296
).result;
297297
break;
298+
case 3:
299+
FSSource = vtkShaderProgram.substitute(
300+
FSSource,
301+
'//VTK::TCoord::Impl',
302+
[
303+
'vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;',
304+
'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,',
305+
' texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,',
306+
' texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, opacity);',
307+
]
308+
).result;
309+
break;
298310
default:
299311
FSSource = vtkShaderProgram.substitute(
300312
FSSource,

0 commit comments

Comments
 (0)