Created
June 20, 2011 22:59
-
-
Save hadronized/1036809 to your computer and use it in GitHub Desktop.
problem with uniforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 400 | |
/* vertex attributes */ | |
in vec3 sky_co; | |
//in vec4 sky_color; | |
/* uniforms */ | |
uniform mat4 sky_view; | |
/* out */ | |
smooth out vec3 point; | |
flat out vec3 eye; | |
smooth out vec4 icolor; | |
void main() { | |
mat4 inv_view = inverse(sky_view); /* screen-space -> world-space */ | |
//icolor = sky_color; | |
gl_Position = vec4(sky_co, 1.0); | |
point = (inv_view * vec4(sky_co, 1.0)).xyz; | |
eye = inv_view[3].xyz; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment