Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Luis Penaranda
panoramic
Commits
f1178162
Commit
f1178162
authored
Aug 13, 2013
by
Luis Penaranda
Browse files
explicitly ask for opengl 2.1, also in shaders
parent
8e1fbd14
Changes
3
Hide whitespace changes
Inline
Side-by-side
glincludes.h
View file @
f1178162
#ifndef GLINCLUDES_H
#define GLINCLUDES_H
// GLew might not be needed on mac, or if a recent version of OpenGL is present
#ifndef __APPLE__
#include
<GL/glew.h>
#if (!defined GLEW_VERSION_1_5) || (!defined GL_VERSION_3_1)
#error GLEW 1.5.2 is required
#endif
#endif
// TODO: test on mac
#define GL_GLEXT_PROTOTYPES 1
#ifdef __APPLE__
#include
<OpenGL/gl.h>
#include
<OpenGL/glu.h>
#include
<Glut/glut.h>
#include
<OpenGL/glext.h>
//
#include<OpenGL/glext.h>
#else
//
#include <GL/gl.h>
//
#include <GL/glu.h>
#include
<GL/gl.h>
#include
<GL/glu.h>
#include
<GL/glut.h>
// is glext really needed?
//#include <GL/glext.h>
#endif
// GLew might not be needed on mac, or if a recent version of OpenGL is present
//#ifndef __APPLE__
#ifndef GL_VERSION_2_1
// OpenGL>=2.1 not found, try GLEW
#include
<GL/glew.h>
#ifndef GLEW_VERSION_2_1
#error OpenGL 2.1 or GLEW is required
#endif
#endif
//#endif
#endif // GLINCLUDES_H
shaders/fragment_shader.frag
View file @
f1178162
#version 120
uniform
sampler2D
diffuse_texture
;
varying
vec2
texcoord0
;
varying
vec4
K_color
;
...
...
shaders/test_vertex_shader.vert
View file @
f1178162
#version 120
varying
vec2
texcoord0
;
vec4
pos
;
float
u
,
v
,
x
,
y
,
z
;
varying
float
r
,
theta
,
s
;
float
lambda
,
phi
;
float
extent
,
scale
,
vis_mode
,
center_lambda
,
center_phi
;
varying
float
zbu
,
zbv
,
zblambda
,
zbr
,
zbR
,
zbalpha
,
zbrho
;
varying
float
zblambda
,
zbr
,
zbR
,
zbalpha
,
zbrho
;
void
main
(
void
){
...
...
@@ -80,13 +82,14 @@ void main(void){
}
else
if
(
vis_mode
==
6
.
0
)
{
// Zorin-Barr
// perspective projection
zbu
=
x
/
(
-
z
);
zbv
=
y
/
(
-
z
);
u
=
x
/
(
-
z
);
v
=
y
/
(
-
z
);
// Z-B transformation
// TODO: read zblambda and zbR from the interface
zblambda
=
0
.
1
;
zbR
=
1
.
0
;
zbalpha
=
atan
(
zbv
,
zb
u
);
zbr
=
sqrt
(
zbu
*
zbu
+
zbv
*
zb
v
);
zbalpha
=
atan
(
v
,
u
);
zbr
=
sqrt
(
u
*
u
+
v
*
v
);
zbrho
=
(
zblambda
*
zbr
/
zbR
)
+
(
1
.
0
-
zblambda
)
*
(
zbR
*
(
sqrt
(
zbr
*
zbr
+
1
.
0
)
-
1
.
0
))
/
(
zbr
*
(
sqrt
(
zbR
*
zbR
+
1
.
0
)
-
1
.
0
));
u
=
zbrho
*
cos
(
zbalpha
);
v
=
zbrho
*
sin
(
zbalpha
);
...
...
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