Commit ea7524e9 authored by Pierre Kraemer's avatar Pierre Kraemer

update shader version declaration for GL3

parent dbe4add0
// ShaderRadiancePerVertex::vertexShaderText // ShaderRadiancePerVertex::vertexShaderText
#extension GL_EXT_gpu_shader4 : enable // need GLSL v1.30 -> if not available, use a uniform for passing textureSize instead of calling textureSize2D //#extension GL_EXT_gpu_shader4 : enable // need GLSL v1.30 -> if not available, use a uniform for passing textureSize instead of calling textureSize2D
ATTRIBUTE vec3 VertexPosition; ATTRIBUTE vec3 VertexPosition;
ATTRIBUTE vec3 VertexNormal; ATTRIBUTE vec3 VertexNormal;
...@@ -69,7 +69,7 @@ void set_eval_direction (vec3 v) ...@@ -69,7 +69,7 @@ void set_eval_direction (vec3 v)
void main () void main ()
{ {
int size = (textureSize2D(texture,0)).x; // supposed square matrix int size = (textureSize(texture,0)).x; // supposed square matrix
//init_K_tab(); //init_K_tab();
vec3 eyeV = normalize(camera - VertexPosition); // normalized outgoing line-of-sight vector vec3 eyeV = normalize(camera - VertexPosition); // normalized outgoing line-of-sight vector
......
// ShaderRadiancePerVertex::fragmentShaderInterpText // ShaderRadiancePerVertex::fragmentShaderInterpText
#extension GL_EXT_gpu_shader4 : enable // need GLSL v1.30 -> if not available, use a uniform for passing textureSize instead of calling textureSize2D //#extension GL_EXT_gpu_shader4 : enable // need GLSL v1.30 -> if not available, use a uniform for passing textureSize instead of calling textureSize2D
PRECISION; PRECISION;
...@@ -75,7 +75,7 @@ void set_eval_direction (vec3 v) ...@@ -75,7 +75,7 @@ void set_eval_direction (vec3 v)
void main (void) void main (void)
{ {
int size = (textureSize2D(texture,0)).x; // supposed square matrix int size = (textureSize(texture,0)).x; // supposed square matrix
vec3 eyeV = normalize(camera - vxPos); // normalized outgoing line-of-sight vector vec3 eyeV = normalize(camera - vxPos); // normalized outgoing line-of-sight vector
eyeV = 2*dot(vxNorm,eyeV)*vxNorm-eyeV ; // symmetrize eyeV = 2*dot(vxNorm,eyeV)*vxNorm-eyeV ; // symmetrize
......
...@@ -39,43 +39,41 @@ namespace CGoGN ...@@ -39,43 +39,41 @@ namespace CGoGN
namespace Utils namespace Utils
{ {
//#ifdef CGOGN_USE_OGL_CORE_PROFILE #ifdef CGOGN_USE_OGL_CORE_PROFILE
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 3; unsigned int GLSLShader::CURRENT_OGL_VERSION = 3;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 3; unsigned int GLSLShader::MAJOR_OGL_CORE = 3;
//unsigned int GLSLShader::MINOR_OGL_CORE = 3; unsigned int GLSLShader::MINOR_OGL_CORE = 3;
//#else #else
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 2; unsigned int GLSLShader::CURRENT_OGL_VERSION = 2;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 2; unsigned int GLSLShader::MAJOR_OGL_CORE = 2;
//unsigned int GLSLShader::MINOR_OGL_CORE = 1; unsigned int GLSLShader::MINOR_OGL_CORE = 1;
//#endif #endif
std::string GLSLShader::DEFINES_GL2=\
"#version 110\n"
//std::string GLSLShader::DEFINES_GL2=\ "#define PRECISION float pipo_PRECISION\n"
//"#version 110\n" "#define ATTRIBUTE attribute\n"
//"#define PRECISION float pipo_PRECISION\n" "#define VARYING_VERT varying\n"
//"#define ATTRIBUTE attribute\n" "#define VARYING_FRAG varying\n"
//"#define VARYING_VERT varying\n" "#define FRAG_OUT_DEF float pipo_FRAGDEF\n"
//"#define VARYING_FRAG varying\n" "#define FRAG_OUT gl_FragColor\n"
//"#define FRAG_OUT_DEF float pipo_FRAGDEF\n" "#define INVARIANT_POS float pipo_INVARIANT\n"
//"#define FRAG_OUT gl_FragColor\n" "#define TEXTURE2D texture2D\n"
//"#define INVARIANT_POS float pipo_INVARIANT\n" ;
//"#define TEXTURE2D texture2D\n";
std::string GLSLShader::DEFINES_GL3=\
"#version 330\n"
//std::string GLSLShader::DEFINES_GL3=\ "#define PRECISION precision highp float\n"
//"#version 150\n" "#define ATTRIBUTE in\n"
//"#define PRECISION precision highp float\n" "#define VARYING_VERT out\n"
//"#define ATTRIBUTE in\n" "#define VARYING_FRAG in\n"
//"#define VARYING_VERT out\n" "#define FRAG_OUT_DEF out vec4 outFragColor\n"
//"#define VARYING_FRAG in\n" "#define FRAG_OUT outFragColor\n"
//"#define FRAG_OUT_DEF out vec4 outFragColor\n" "#define INVARIANT_POS invariant gl_Position\n"
//"#define FRAG_OUT outFragColor\n" "#define TEXTURE2D texture\n"
//"#define INVARIANT_POS invariant gl_Position\n" ;
//"#define TEXTURE2D texture\n";
std::string* GLSLShader::DEFINES_GL = NULL;
//std::string* GLSLShader::DEFINES_GL = NULL;
std::vector<std::string> GLSLShader::m_pathes; std::vector<std::string> GLSLShader::m_pathes;
......
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