Commit 426bff1d authored by Jan Möbius's avatar Jan Möbius

Merge branch 'featurePickingShaderGenerator' into 'master'

use the shadergenerator for the picking shaders.

See merge request !1
parents 991627ec cb10c2d5
......@@ -455,7 +455,10 @@ pick_vertices( GLState& _state )
glDepthRange(0.0, 0.999999);
GLSL::Program* pickShader = ACG::ShaderCache::getInstance()->getProgram("Picking/pick_vertices_vs.glsl", "Picking/pick_vertices_fs.glsl", 0, false);
static ShaderGenDesc desc;
desc.vertexTemplateFile = "Picking/pick_vertices_vs.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs.glsl";
GLSL::Program* pickShader = ACG::ShaderCache::getInstance()->getProgram(&desc, nullptr);
if (pickShader && pickShader->isLinked())
{
......@@ -567,7 +570,18 @@ pick_edges( GLState& _state, unsigned int _offset)
glDepthRange(0.0, 0.999999);
GLSL::Program* pickShader = ACG::ShaderCache::getInstance()->getProgram("Picking/vertex.glsl", "Picking/pick_vertices_fs2.glsl", 0, false);
static ShaderGenDesc desc;
if(ACG::openGLVersionTest(3,2))
{
desc.vertexTemplateFile = "Picking/vertex.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs2.glsl";
}
else
{
desc.vertexTemplateFile = "Picking/pick_vertices_vs.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs.glsl";
}
GLSL::Program* pickShader = ACG::ShaderCache::getInstance()->getProgram(&desc, nullptr);
if (pickShader && pickShader->isLinked())
{
......
......@@ -368,8 +368,10 @@ pick_vertices(GLState &_state)
float point_size_old = _state.point_size();
glPointSize(point_size_old+3.0f);
GLSL::Program* pickVertexShader = ACG::ShaderCache::getInstance()->getProgram("Picking/pick_vertices_vs.glsl", "Picking/pick_vertices_fs.glsl");
static ShaderGenDesc desc;
desc.vertexTemplateFile = "Picking/pick_vertices_vs.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs.glsl";
GLSL::Program* pickVertexShader = ACG::ShaderCache::getInstance()->getProgram(&desc, nullptr);
if (pickVertexShader && pickVertexShader->isLinked())
{
......@@ -447,7 +449,18 @@ pick_edges(GLState &_state, unsigned int _offset)
float line_width_old = _state.line_width();
glLineWidth(line_width_old+3.0f);
GLSL::Program* pickEdgeShader = ACG::ShaderCache::getInstance()->getProgram("Picking/vertex.glsl", "Picking/pick_vertices_fs2.glsl");
static ShaderGenDesc desc;
if(ACG::openGLVersionTest(3,2))
{
desc.vertexTemplateFile = "Picking/vertex.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs2.glsl";
}
else
{
desc.vertexTemplateFile = "Picking/pick_vertices_vs.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs.glsl";
}
GLSL::Program* pickEdgeShader = ACG::ShaderCache::getInstance()->getProgram(&desc, nullptr);
if (pickEdgeShader && pickEdgeShader->isLinked())
{
......
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