From d6c2fa8f52371484de0040fe383972e865c69d83 Mon Sep 17 00:00:00 2001 From: Forrest Li Date: Fri, 7 Aug 2020 13:29:45 -0400 Subject: [PATCH] fix(OpenGL/ImageMapper): Reset texture format for pwf --- Sources/Rendering/OpenGL/ImageMapper/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Rendering/OpenGL/ImageMapper/index.js b/Sources/Rendering/OpenGL/ImageMapper/index.js index c6c5595e6e6..1cf4c5eda2b 100644 --- a/Sources/Rendering/OpenGL/ImageMapper/index.js +++ b/Sources/Rendering/OpenGL/ImageMapper/index.js @@ -716,6 +716,8 @@ function vtkOpenGLImageMapper(publicAPI, model) { const pwfSize = pwfWidth * textureHeight; const pwfTable = new Uint8Array(pwfSize); let pwfun = actorProperty.getPiecewiseFunction(); + // support case where pwfun is added/removed + model.pwfTexture.resetFormatAndType(); if (pwfun) { const pwfFloatTable = new Float32Array(pwfSize); const tmpTable = new Float32Array(pwfWidth);