Commit a0e478cc authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'fix_image_lic'

ce5e2743

 Fix an issue with image lic resulting in blank images
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !1197
parents 1af983b1 ce5e2743
Pipeline #6661 failed with stage
...@@ -86,7 +86,6 @@ vtkImageDataLIC2D::vtkImageDataLIC2D() ...@@ -86,7 +86,6 @@ vtkImageDataLIC2D::vtkImageDataLIC2D()
0, 0,
vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataObject::FIELD_ASSOCIATION_POINTS,
vtkDataSetAttributes::VECTORS); vtkDataSetAttributes::VECTORS);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -470,9 +469,29 @@ int vtkImageDataLIC2D::RequestData( ...@@ -470,9 +469,29 @@ int vtkImageDataLIC2D::RequestData(
1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f}; -1.0f, 1.0f, 0.0f};
vectorTex->CopyToFrameBuffer(tcoords, verts, NULL, NULL); vtkOpenGLHelper shaderHelper;
// build the shader source code
shaderHelper.Program =
this->Context->GetShaderCache()->ReadyShaderProgram(
vtkTextureObjectVS,
"//VTK::System::Dec\n"
"varying vec2 tcoordVC;\n"
"uniform sampler2D source;\n"
"//VTK::Output::Dec\n"
"void main(void) {\n"
" gl_FragData[0] = texture2D(source,tcoordVC); }\n",
"");
// bind and activate this texture
vectorTex->Activate();
int sourceId = vectorTex->GetTextureUnit();
shaderHelper.Program->SetUniformi("source",sourceId);
vectorTex->CopyToFrameBuffer(tcoords, verts,
shaderHelper.Program, shaderHelper.VAO);
vectorTex->Deactivate();
vectorTex->Delete(); vectorTex->Delete();
shaderHelper.ReleaseGraphicsResources(this->Context);
drawFbo->UnBind(GL_FRAMEBUFFER); drawFbo->UnBind(GL_FRAMEBUFFER);
drawFbo->Delete(); drawFbo->Delete();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment