Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
dfe12705
Commit
dfe12705
authored
Apr 27, 2011
by
Sylvain Thery
Browse files
MAJ bug de compilation GLSL sur mac
parent
0603269f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Apps/Tuto/tuto4.cpp
View file @
dfe12705
...
...
@@ -62,7 +62,7 @@ AttributeHandler<Geom::Vec4f> color ;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
3
);
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
src/Utils/GLSLShader.cpp
View file @
dfe12705
...
...
@@ -41,22 +41,22 @@ unsigned int GLSLShader::CURRENT_OGL_VERSION=2;
std
::
string
GLSLShader
::
DEFINES_GL2
=
\
"#version 110
\n
"
"#define PRECISON
\n
"
"#define PRECISON
float pipo_PRECISION
\n
"
"#define ATTRIBUTE attribute
\n
"
"#define VARYING_VERT varying
\n
"
"#define VARYING_FRAG varying
\n
"
"#define FRAG_OUT_DEF
\n
"
"#define INVARIANT_POS
\n
"
;
"#define FRAG_OUT_DEF
float pipo_FRAGDEF
\n
"
"#define INVARIANT_POS
float pipo_INVARIANT
\n
"
;
std
::
string
GLSLShader
::
DEFINES_GL3
=
\
"#version 150
\n
"
"#define PRECISON precision highp float
;
\n
"
"#define PRECISON precision highp float
\n
"
"#define ATTRIBUTE in
\n
"
"#define VARYING_VERT smooth out
\n
"
"#define VARYING_FRAG smooth in
\n
"
"#define FRAG_OUT_DEF out vec4 gl_FragColor
\n
"
"#define INVARIANT_POS
\n
"
;
"#define INVARIANT_POS
invariant gl_Position
\n
"
;
std
::
string
*
GLSLShader
::
DEFINES_GL
=
NULL
;
...
...
@@ -113,6 +113,7 @@ std::string GLSLShader::defines_Geom(const std::string& primitivesIn, const std:
str
.
append
(
"#define VARYING_IN in
\n
"
);
str
.
append
(
"#define VARYING_OUT smooth out
\n
"
);
str
.
append
(
"#define POSITION_IN(X) gl_in[X].gl_Position
\n
"
);
str
.
append
(
"#define NBVERTS_IN gl_in.length()
\n
"
);
return
str
;
}
else
...
...
@@ -123,6 +124,7 @@ std::string GLSLShader::defines_Geom(const std::string& primitivesIn, const std:
str
.
append
(
"#define VARYING_IN varying in
\n
"
);
str
.
append
(
"#define VARYING_OUT varying out
\n
"
);
str
.
append
(
"#define POSITION_IN(X) gl_PositionIn[X]
\n
"
);
str
.
append
(
"#define NBVERTS_IN gl_VerticesIn
\n
"
);
return
str
;
}
}
...
...
src/Utils/shaderFlat.cpp
View file @
dfe12705
...
...
@@ -66,7 +66,7 @@ std::string ShaderFlat::geometryShaderText =
" if(lambertTerm > 0.0)
\n
"
" ColorFS += diffuse * lambertTerm;
\n
"
" int i;
\n
"
" for(i=0; i<
gl_in.length()
; i++)
\n
"
" for(i=0; i<
NBVERTS_IN
; i++)
\n
"
" {
\n
"
" vec4 pos = explode * POSITION_IN(i) + (1.0-explode)* vec4(center,1.0);
\n
"
" gl_Position = ModelViewProjectionMatrix * pos;
\n
"
...
...
src/Utils/shaderSimpleColor.cpp
View file @
dfe12705
...
...
@@ -33,7 +33,7 @@ namespace Utils
std
::
string
ShaderSimpleColor
::
vertexShaderText
=
"ATTRIBUTE vec3 VertexPosition, VertexNormal;
\n
"
"uniform mat4 ModelViewProjectionMatrix;
\n
"
"INVARIANT_POS;
\n
"
//
"INVARIANT_POS;\n"
"void main ()
\n
"
"{
\n
"
" gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);
\n
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment