Skip to content

Instantly share code, notes, and snippets.

@hadronized
Created June 20, 2011 22:59
Show Gist options
  • Save hadronized/1036809 to your computer and use it in GitHub Desktop.
Save hadronized/1036809 to your computer and use it in GitHub Desktop.
problem with uniforms
#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