Removed deprecated setting of shader directives for geometry shaders in...

Removed deprecated setting of shader directives for geometry shaders in tgt::ShaderManager. This hopefully fixes GeometryRenderer single-pass wireframe rendering on non-permissive GPU drivers.
parent 7880f0c2
......@@ -299,12 +299,6 @@ void ShaderObject::uploadSource() {
glShaderSource(id_, 1, &s, 0);
}
void ShaderObject::setDirectives(GLuint id) {
glProgramParameteriEXT(id, GL_GEOMETRY_INPUT_TYPE_EXT, inputType_);
glProgramParameteriEXT(id, GL_GEOMETRY_OUTPUT_TYPE_EXT, outputType_);
glProgramParameteriEXT(id, GL_GEOMETRY_VERTICES_OUT_EXT, verticesOut_);
}
bool ShaderObject::compileShader() {
isCompiled_ = false;
......@@ -510,21 +504,6 @@ void Shader::detachObjectsByType(ShaderObject::ShaderType type) {
}
bool Shader::linkProgram() {
if (isLinked_) {
// program is already linked: detach and re-attach everything
for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) {
glDetachShader(id_, (*iter)->id_);
glAttachShader(id_, (*iter)->id_);
if ((*iter)->getType() == ShaderObject::GEOMETRY_SHADER)
(*iter)->setDirectives(id_);
}
} else {
for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) {
if ((*iter)->getType() == ShaderObject::GEOMETRY_SHADER)
(*iter)->setDirectives(id_);
}
}
isLinked_ = false;
glLinkProgram(id_);
GLint check = 0;
......
......@@ -98,13 +98,6 @@ public:
void loadSourceFromFile(const std::string& filename)
throw (Exception);
/**
* Set directives using glProgramParameteriEXT(...), used for geometry shaders.
* Call before compiling.
* @param id Set the directives for this shader
*/
void setDirectives(GLuint id);
bool compileShader();
bool isCompiled() const { return isCompiled_; }
......
......@@ -39,7 +39,7 @@ out vec4 out_Color;
uniform bool _useSolidColor;
uniform vec4 _solidColor;
uniform vec4 _wireframeColor;
uniform float _lineWidth;
uniform float _lineWidth = 1.0;
uniform LightSource _lightSource;
uniform vec3 _cameraPosition;
......
......@@ -62,7 +62,7 @@ void main() {
float hc = abs(b * sin(alpha));
// Send the triangle along with the edge distances
geom_EdgeDistance = vec3(ha, 0, 0);
geom_EdgeDistance = vec3(ha, 0.0, 0.0);
geom_Normal = _computeNormals ? normal : vert_Normal[0];
geom_Position = vert_Position[0];
geom_TexCoord = vert_TexCoord[0];
......@@ -70,7 +70,7 @@ void main() {
gl_Position = gl_in[0].gl_Position;
EmitVertex();
geom_EdgeDistance = vec3(0, hb, 0);
geom_EdgeDistance = vec3(0.0, hb, 0.0);
geom_Normal = _computeNormals ? normal : vert_Normal[1];
geom_Position = vert_Position[1];
geom_TexCoord = vert_TexCoord[1];
......@@ -78,7 +78,7 @@ void main() {
gl_Position = gl_in[1].gl_Position;
EmitVertex();
geom_EdgeDistance = vec3(0, 0, hc);
geom_EdgeDistance = vec3(0.0, 0.0, hc);
geom_Normal = _computeNormals ? normal : vert_Normal[2];
geom_Position = vert_Position[2];
geom_TexCoord = vert_TexCoord[2];
......
......@@ -88,7 +88,7 @@ namespace campvis {
void GeometryRenderer::init() {
VisualizationProcessor::init();
_pointShader = ShdrMgr.load("modules/vis/glsl/geometryrenderer.vert", "modules/vis/glsl/geometryrenderer.frag", generateGlslHeader(false));
_meshShader = ShdrMgr.load("modules/vis/glsl/geometryrenderer.vert", "modules/vis/glsl/geometryrenderer_faces.geom", "modules/vis/glsl/geometryrenderer.frag", generateGlslHeader(true));
_meshShader = ShdrMgr.load("modules/vis/glsl/geometryrenderer.vert", "modules/vis/glsl/geometryrenderer.geom", "modules/vis/glsl/geometryrenderer.frag", generateGlslHeader(true));
}
void GeometryRenderer::deinit() {
......
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