Commit ea7524e9 authored by Pierre Kraemer's avatar Pierre Kraemer

update shader version declaration for GL3

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