Commit 409b4c5e authored by Ken Martin's avatar Ken Martin

A fix for shader link error reporting an molecules with lightkit

One fix is to properly report errors when a shader program fails to
link.  The other is to fix rendering molecules when using light kit
or positional lights.

Change-Id: I74d938f2986f421c61ffdcf03e69a6b728ffe484
parent 70bad0eb
......@@ -74,12 +74,8 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
"uniform float invertedDepth;\n"
"uniform int cameraParallel;\n"
"varying float radiusVC;\n"
"varying vec3 centerVC;\n";
if (lightComplexity < 2)
{
replacement += "uniform mat4 VCDCMatrix;\n";
}
"varying vec3 centerVC;\n"
"uniform mat4 VCDCMatrix;\n";
substitute(FSSource,"//VTK::Normal::Dec",replacement);
substitute(FSSource,"//VTK::Normal::Impl",
......
......@@ -76,12 +76,8 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
"varying float radiusVC;\n"
"varying vec3 orientVC;\n"
"varying float lengthVC;\n"
"varying vec3 centerVC;\n";
if (lightComplexity < 2)
{
replacement += "uniform mat4 VCDCMatrix;\n";
}
"varying vec3 centerVC;\n"
"uniform mat4 VCDCMatrix;\n";
substitute(FSSource,"//VTK::Normal::Dec",replacement);
......
......@@ -232,11 +232,11 @@ bool vtkShaderProgram::Link()
if (isCompiled == 0)
{
GLint length(0);
glGetShaderiv(static_cast<GLuint>(this->Handle), GL_INFO_LOG_LENGTH, &length);
glGetProgramiv(static_cast<GLuint>(this->Handle), GL_INFO_LOG_LENGTH, &length);
if (length > 1)
{
char *logMessage = new char[length];
glGetShaderInfoLog(static_cast<GLuint>(this->Handle), length, NULL, logMessage);
glGetProgramInfoLog(static_cast<GLuint>(this->Handle), length, NULL, logMessage);
this->Error = logMessage;
delete[] logMessage;
}
......
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