Commit 19d616bc authored by Ken Martin's avatar Ken Martin

Fix an error with depth peeeling and glyph rep

When depth peeling is used the glyph was still trying
to set glyphColors even though they were not used
resulting in an error message.
parent a8ebfa8c
......@@ -554,16 +554,18 @@ void vtkOpenGLGlyph3DHelper::GlyphRenderInstances(
this->NormalMatrixBuffer->Release();
}
this->ColorBuffer->Bind();
this->ColorBuffer->Upload(colors, vtkOpenGLBufferObject::ArrayBuffer);
if (!this->Primitives[PrimitiveTris].VAO->AddAttributeArrayWithDivisor(
this->Primitives[PrimitiveTris].Program, this->ColorBuffer,
"glyphColor", 0, 4*sizeof(unsigned char), VTK_UNSIGNED_CHAR, 4, true, 1, false))
if (this->Primitives[PrimitiveTris].Program->IsAttributeUsed("glyphColor"))
{
vtkErrorMacro(<< "Error setting 'diffuse color' in shader VAO.");
this->ColorBuffer->Bind();
this->ColorBuffer->Upload(colors, vtkOpenGLBufferObject::ArrayBuffer);
if (!this->Primitives[PrimitiveTris].VAO->AddAttributeArrayWithDivisor(
this->Primitives[PrimitiveTris].Program, this->ColorBuffer,
"glyphColor", 0, 4*sizeof(unsigned char), VTK_UNSIGNED_CHAR, 4, true, 1, false))
{
vtkErrorMacro(<< "Error setting 'diffuse color' in shader VAO.");
}
this->ColorBuffer->Release();
}
this->ColorBuffer->Release();
this->InstanceBuffersLoadTime.Modified();
}
......
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