Merge pull request #3611 from maxGimeno/Demo-Rename_shader_files-GF

Polyhedron_demo: Rename shader files
This commit is contained in:
Laurent Rineau 2019-02-07 13:31:18 +01:00
commit b4cab8e6b6
54 changed files with 106 additions and 106 deletions

View File

@ -203,13 +203,13 @@ struct Scene_edit_box_item_priv{
if(QOpenGLContext::currentContext()->format().majorVersion() >= 3)
{
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/shader_spheres.v");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/shader_without_light.f");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/shader_spheres.vert");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/shader_without_light.frag");
}
else
{
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_spheres.v");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.f");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_spheres.vert");
pick_sphere_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.frag");
}
pick_sphere_program.bindAttributeLocation("colors", 1);
pick_sphere_program.link();

View File

@ -342,7 +342,7 @@ Scene_alpha_shape_item::Scene_alpha_shape_item(Scene_points_with_normal_item *po
{
facet_program.addShaderFromSourceCode(QOpenGLShader::Vertex, vertex_source_comp);
}
facet_program.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_old_flat.f");
facet_program.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_old_flat.frag");
facet_program.link();
invalidateOpenGLBuffers();
alpha_changed(alpha);

View File

@ -34,23 +34,23 @@
</qresource>
<qresource prefix="/cgal/Polyhedron_3">
<file alias="about.html">resources/about.html</file>
<file>resources/shader_with_light.v</file>
<file>resources/shader_with_light.f</file>
<file>resources/shader_without_light.f</file>
<file>resources/shader_without_light.v</file>
<file>resources/shader_with_texture.f</file>
<file>resources/shader_with_textured_edges.f</file>
<file>resources/shader_with_textured_edges.v</file>
<file>resources/shader_with_texture.v</file>
<file>resources/shader_instanced.v</file>
<file>resources/shader_no_light_no_selection.f</file>
<file>resources/shader_c3t3_spheres.v</file>
<file>resources/shader_c3t3_edges.v</file>
<file>resources/shader_c3t3_edges.f</file>
<file>resources/shader_c3t3.v</file>
<file>resources/shader_c3t3.f</file>
<file>resources/shader_plane_two_faces.f</file>
<file>resources/shader_spheres.v</file>
<file>resources/shader_with_light.vert</file>
<file>resources/shader_with_light.frag</file>
<file>resources/shader_without_light.frag</file>
<file>resources/shader_without_light.vert</file>
<file>resources/shader_with_texture.frag</file>
<file>resources/shader_with_textured_edges.frag</file>
<file>resources/shader_with_textured_edges.vert</file>
<file>resources/shader_with_texture.vert</file>
<file>resources/shader_instanced.vert</file>
<file>resources/shader_no_light_no_selection.frag</file>
<file>resources/shader_c3t3_spheres.vert</file>
<file>resources/shader_c3t3_edges.vert</file>
<file>resources/shader_c3t3_edges.frag</file>
<file>resources/shader_c3t3.vert</file>
<file>resources/shader_c3t3.frag</file>
<file>resources/shader_plane_two_faces.frag</file>
<file>resources/shader_spheres.vert</file>
<file>resources/general_collapse.png</file>
<file>resources/add_facet1.png</file>
<file>resources/add_facet2.png</file>
@ -58,7 +58,7 @@
<file>resources/euler_facet.png</file>
<file>resources/euler_vertex.png</file>
<file>javascript/lib.js</file>
<file>resources/shader_flat.f</file>
<file>resources/shader_flat.frag</file>
<file>resources/hexahedron.png</file>
<file>resources/icosphere.png</file>
<file>resources/tetrahedron.png</file>
@ -67,37 +67,37 @@
<file>resources/prism-open.png</file>
<file>resources/pyramid.png</file>
<file>resources/pyramid-open.png</file>
<file>resources/no_interpolation_shader.f</file>
<file>resources/no_interpolation_shader.g</file>
<file>resources/no_interpolation_shader.v</file>
<file>resources/shader_flat.g</file>
<file>resources/shader_flat.v</file>
<file>resources/shader_old_flat.f</file>
<file>resources/solid_wireframe_shader.v</file>
<file>resources/solid_wireframe_shader.f</file>
<file>resources/solid_wireframe_shader.g</file>
<file>resources/compatibility_shaders/shader_c3t3_edges.f</file>
<file>resources/compatibility_shaders/shader_c3t3_edges.v</file>
<file>resources/compatibility_shaders/shader_c3t3_spheres.v</file>
<file>resources/compatibility_shaders/shader_c3t3.f</file>
<file>resources/compatibility_shaders/shader_c3t3.v</file>
<file>resources/compatibility_shaders/shader_instanced.v</file>
<file>resources/compatibility_shaders/shader_no_light_no_selection.f</file>
<file>resources/compatibility_shaders/shader_old_flat.f</file>
<file>resources/compatibility_shaders/shader_plane_two_faces.f</file>
<file>resources/compatibility_shaders/shader_spheres.v</file>
<file>resources/compatibility_shaders/shader_with_light.f</file>
<file>resources/compatibility_shaders/shader_with_light.v</file>
<file>resources/compatibility_shaders/shader_with_texture.f</file>
<file>resources/compatibility_shaders/shader_with_texture.v</file>
<file>resources/compatibility_shaders/shader_with_textured_edges.f</file>
<file>resources/compatibility_shaders/shader_with_textured_edges.v</file>
<file>resources/compatibility_shaders/shader_without_light.f</file>
<file>resources/compatibility_shaders/shader_without_light.v</file>
<file>resources/heat_intensity_shader.f</file>
<file>resources/heat_intensity_shader.v</file>
<file>resources/compatibility_shaders/heat_intensity_shader.f</file>
<file>resources/compatibility_shaders/heat_intensity_shader.v</file>
<file>resources/no_interpolation_shader.frag</file>
<file>resources/no_interpolation_shader.geom</file>
<file>resources/no_interpolation_shader.vert</file>
<file>resources/shader_flat.geom</file>
<file>resources/shader_flat.vert</file>
<file>resources/shader_old_flat.frag</file>
<file>resources/solid_wireframe_shader.vert</file>
<file>resources/solid_wireframe_shader.frag</file>
<file>resources/solid_wireframe_shader.geom</file>
<file>resources/compatibility_shaders/shader_c3t3_edges.frag</file>
<file>resources/compatibility_shaders/shader_c3t3_edges.vert</file>
<file>resources/compatibility_shaders/shader_c3t3_spheres.vert</file>
<file>resources/compatibility_shaders/shader_c3t3.frag</file>
<file>resources/compatibility_shaders/shader_c3t3.vert</file>
<file>resources/compatibility_shaders/shader_instanced.vert</file>
<file>resources/compatibility_shaders/shader_no_light_no_selection.frag</file>
<file>resources/compatibility_shaders/shader_old_flat.frag</file>
<file>resources/compatibility_shaders/shader_plane_two_faces.frag</file>
<file>resources/compatibility_shaders/shader_spheres.vert</file>
<file>resources/compatibility_shaders/shader_with_light.frag</file>
<file>resources/compatibility_shaders/shader_with_light.vert</file>
<file>resources/compatibility_shaders/shader_with_texture.frag</file>
<file>resources/compatibility_shaders/shader_with_texture.vert</file>
<file>resources/compatibility_shaders/shader_with_textured_edges.frag</file>
<file>resources/compatibility_shaders/shader_with_textured_edges.vert</file>
<file>resources/compatibility_shaders/shader_without_light.frag</file>
<file>resources/compatibility_shaders/shader_without_light.vert</file>
<file>resources/heat_intensity_shader.frag</file>
<file>resources/heat_intensity_shader.vert</file>
<file>resources/compatibility_shaders/heat_intensity_shader.frag</file>
<file>resources/compatibility_shaders/heat_intensity_shader.vert</file>
</qresource>
<qresource prefix="/cgal/cursors">
<file>resources/rotate_around_cursor.png</file>

View File

@ -592,16 +592,16 @@ void Scene_image_item_priv::compile_shaders()
}
else
{
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/no_interpolation_shader.v"))
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Vertex,":/cgal/Polyhedron_3/resources/no_interpolation_shader.vert"))
{
std::cerr<<"adding vertex shader FAILED"<<std::endl;
}
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/no_interpolation_shader.f"))
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Fragment,":/cgal/Polyhedron_3/resources/no_interpolation_shader.frag"))
{
std::cerr<<"adding fragment shader FAILED"<<std::endl;
}
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/no_interpolation_shader.g"))
if(!rendering_program.addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/no_interpolation_shader.geom"))
{
std::cerr<<"adding geometry shader FAILED"<<std::endl;
}

View File

@ -1043,16 +1043,16 @@ QOpenGLShaderProgram* Viewer::declare_program(int name,
}
if(isOpenGL_4_3())
{
if(strcmp(f_shader,":/cgal/Polyhedron_3/resources/shader_flat.f" ) == 0)
if(strcmp(f_shader,":/cgal/Polyhedron_3/resources/shader_flat.frag" ) == 0)
{
if(!program->addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/shader_flat.g" ))
if(!program->addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/shader_flat.geom" ))
{
std::cerr<<"adding geometry shader FAILED"<<std::endl;
}
}
if(strcmp(f_shader,":/cgal/Polyhedron_3/resources/solid_wireframe_shader.f" ) == 0)
if(strcmp(f_shader,":/cgal/Polyhedron_3/resources/solid_wireframe_shader.frag" ) == 0)
{
if(!program->addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/solid_wireframe_shader.g" ))
if(!program->addShaderFromSourceFile(QOpenGLShader::Geometry,":/cgal/Polyhedron_3/resources/solid_wireframe_shader.geom" ))
{
std::cerr<<"adding geometry shader FAILED"<<std::endl;
}
@ -1071,9 +1071,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_C3T3:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3.v" , ":/cgal/Polyhedron_3/resources/shader_c3t3.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3.vert" , ":/cgal/Polyhedron_3/resources/shader_c3t3.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasCutPlane", true);
@ -1083,18 +1083,18 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_C3T3_EDGES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.v" , ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.vert" , ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.frag");
program->setProperty("hasCutPlane", true);
return program;
}
case PROGRAM_WITH_LIGHT:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_light.v" , ":/cgal/Polyhedron_3/resources/shader_with_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_light.vert" , ":/cgal/Polyhedron_3/resources/shader_with_light.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasTransparency", true);
@ -1104,9 +1104,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_HEAT_INTENSITY:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/heat_intensity_shader.v" , ":/cgal/Polyhedron_3/resources/heat_intensity_shader.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/heat_intensity_shader.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/heat_intensity_shader.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/heat_intensity_shader.vert" , ":/cgal/Polyhedron_3/resources/heat_intensity_shader.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/heat_intensity_shader.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/heat_intensity_shader.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasTransparency", true);
@ -1116,27 +1116,27 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_WITHOUT_LIGHT:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_without_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.vert" , ":/cgal/Polyhedron_3/resources/shader_without_light.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.frag");
program->setProperty("hasFMatrix", true);
return program;
}
case PROGRAM_NO_SELECTION:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_no_light_no_selection.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_no_light_no_selection.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.vert" , ":/cgal/Polyhedron_3/resources/shader_no_light_no_selection.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_no_light_no_selection.frag");
program->setProperty("hasFMatrix", true);
return program;
}
case PROGRAM_WITH_TEXTURE:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_texture.v" , ":/cgal/Polyhedron_3/resources/shader_with_texture.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_texture.vert" , ":/cgal/Polyhedron_3/resources/shader_with_texture.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasFMatrix", true);
@ -1146,9 +1146,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_PLANE_TWO_FACES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
?declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_plane_two_faces.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_plane_two_faces.f");
?declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.vert" , ":/cgal/Polyhedron_3/resources/shader_plane_two_faces.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_plane_two_faces.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
return program;
@ -1156,9 +1156,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_WITH_TEXTURED_EDGES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.v" , ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.vert" , ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.frag");
program->setProperty("hasFMatrix", true);
program->setProperty("hasTexture", true);
return program;
@ -1166,9 +1166,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_INSTANCED:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_instanced.v" , ":/cgal/Polyhedron_3/resources/shader_with_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_instanced.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_instanced.vert" , ":/cgal/Polyhedron_3/resources/shader_with_light.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_instanced.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
@ -1178,9 +1178,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_INSTANCED_WIRE:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_instanced.v" , ":/cgal/Polyhedron_3/resources/shader_without_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_instanced.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_instanced.vert" , ":/cgal/Polyhedron_3/resources/shader_without_light.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_instanced.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasBarycenter", true);
@ -1190,9 +1190,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_CUTPLANE_SPHERES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_spheres.v" , ":/cgal/Polyhedron_3/resources/shader_c3t3.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_spheres.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.f");
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_spheres.vert" , ":/cgal/Polyhedron_3/resources/shader_c3t3.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_spheres.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasBarycenter", true);
@ -1203,9 +1203,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_SPHERES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
?declare_program(name, ":/cgal/Polyhedron_3/resources/shader_spheres.v" , ":/cgal/Polyhedron_3/resources/shader_with_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_spheres.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.f");
?declare_program(name, ":/cgal/Polyhedron_3/resources/shader_spheres.vert" , ":/cgal/Polyhedron_3/resources/shader_with_light.frag")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_spheres.vert" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasBarycenter", true);
@ -1221,7 +1221,7 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
std::cerr<<"An OpenGL context of version 4.3 is required for the program ("<<name<<")."<<std::endl;
return 0;
}
QOpenGLShaderProgram* program = declare_program(name, ":/cgal/Polyhedron_3/resources/shader_flat.v", ":/cgal/Polyhedron_3/resources/shader_flat.f");
QOpenGLShaderProgram* program = declare_program(name, ":/cgal/Polyhedron_3/resources/shader_flat.vert", ":/cgal/Polyhedron_3/resources/shader_flat.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
return program;
@ -1229,10 +1229,10 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
case PROGRAM_OLD_FLAT:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_light.v", ":/cgal/Polyhedron_3/resources/shader_old_flat.f")
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_light.vert", ":/cgal/Polyhedron_3/resources/shader_old_flat.frag")
: declare_program(name,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.v",
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_old_flat.f");
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.vert",
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_old_flat.frag");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
return program;
@ -1244,8 +1244,8 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
return 0;
}
return declare_program(name,
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.v",
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.f");
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.vert",
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.frag");
break;
default:
std::cerr<<"ERROR : Program not found."<<std::endl;