Skip to content

Commit

Permalink
IECoreGL::CurvesPrimitive : Default to constant shader for GL lines
Browse files Browse the repository at this point in the history
Previously, this was getting a default facing shader, which seems to be failing on GL lines, and rendering black
  • Loading branch information
danieldresser committed Mar 31, 2020
1 parent 70dad6d commit f17f17d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/IECoreGL/CurvesPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ const Shader::Setup *CurvesPrimitive::shaderSetup( const Shader *shader, State *
}
else
{
geometryShader = shaderLoader->create( geometryShader->vertexSource(), cubicLinesGeometrySource(), geometryShader->fragmentSource() );
// When drawing as lines, default to the constant fragment source, because using a facing ratio
// shader doesn't work
geometryShader = shaderLoader->create(
geometryShader->vertexSource(), cubicLinesGeometrySource(),
geometryShader->fragmentSource() != "" ? geometryShader->fragmentSource() : Shader::constantFragmentSource()
);
}
}

Expand Down

0 comments on commit f17f17d

Please sign in to comment.