projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quick backup
[demo]
/
gl_shaders
/
default.v.glsl
diff --git
a/gl_shaders/default.v.glsl
b/gl_shaders/default.v.glsl
index
59db728
..
2876699
100644
(file)
--- a/
gl_shaders/default.v.glsl
+++ b/
gl_shaders/default.v.glsl
@@
-2,24
+2,23
@@
//#extension GL_ARB_separate_shader_objects : enable
uniform mat4 mview;
//#extension GL_ARB_separate_shader_objects : enable
uniform mat4 mview;
-uniform mat4 mproj;
+uniform mat4 mmviewproj;
varying vec3 pos;
varying vec3 normal;
varying vec3 ldir;
varying vec3 pos;
varying vec3 normal;
varying vec3 ldir;
-varying vec3 tex_coord;
+varying vec2 tex_coord;
-const vec3 lpos = vec3(0.0, 100.0, 0.0);
+const vec3 lpos = vec3(50.0, 50.0, -200.0);
/* attributes */
layout(location = 1) in vec3 attr_pos;
layout(location = 2) in vec3 attr_normal;
/* attributes */
layout(location = 1) in vec3 attr_pos;
layout(location = 2) in vec3 attr_normal;
-layout(location = 3) in vec3 attr_tex;
+layout(location = 3) in vec2 attr_tex;
void main()
{
void main()
{
- mat4 modelview_projection_matrix = mproj * mview;
- gl_Position = modelview_projection_matrix * vec4(attr_pos, 1.0);
+ gl_Position = mmviewproj * vec4(attr_pos, 1.0);
pos = (mview * vec4(attr_pos, 1.0)).xyz;
ldir = (mview * vec4(lpos, 1.0)).xyz;
pos = (mview * vec4(attr_pos, 1.0)).xyz;
ldir = (mview * vec4(lpos, 1.0)).xyz;