Commit 2e04e187 authored by Ken Martin's avatar Ken Martin

Fix for glyph3d picking

Glyph also needed a change for picking updates.
parent 571a5da7
......@@ -346,6 +346,23 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderClip(
this->Superclass::ReplaceShaderClip(shaders,ren,actor);
}
void vtkOpenGLGlyph3DHelper::ReplaceShaderPicking(
std::map<vtkShader::Type, vtkShader *> shaders,
vtkRenderer *, vtkActor *)
{
std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
if (this->LastSelectionState >= vtkHardwareSelector::MIN_KNOWN_PASS)
{
vtkShaderProgram::Substitute(FSSource, "//VTK::Picking::Dec",
"uniform vec3 mapperIndex;");
vtkShaderProgram::Substitute(FSSource,
"//VTK::Picking::Impl",
" gl_FragData[0] = vec4(mapperIndex,1.0);\n");
}
shaders[vtkShader::Fragment]->SetSource(FSSource);
}
void vtkOpenGLGlyph3DHelper::GlyphRender(
vtkRenderer* ren,
vtkActor* actor,
......
......@@ -84,6 +84,9 @@ protected:
// Description:
// Perform string replacments on the shader templates
virtual void ReplaceShaderPicking(
std::map<vtkShader::Type, vtkShader *> shaders,
vtkRenderer *ren, vtkActor *act);
virtual void ReplaceShaderColor(
std::map<vtkShader::Type, vtkShader *> shaders,
vtkRenderer *ren, vtkActor *act);
......
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