Skip to content

Instantly share code, notes, and snippets.

@bvssvni
Created July 27, 2014 13:38
Show Gist options
  • Save bvssvni/2e007159d336a19f3755 to your computer and use it in GitHub Desktop.
Save bvssvni/2e007159d336a19f3755 to your computer and use it in GitHub Desktop.
static VERTEX_SHADER_330: &'static str = r"
#version 330
uniform mat4 projection, view;
in vec2 tex_coord;
in vec3 color;
in vec3 position;
out vec2 v_tex_coord;
out vec3 v_color;
void main() {
v_tex_coord = tex_coord;
v_color = color;
gl_Position = projection * view * vec4(position, 1.0);
}
";
static FRAGMENT_SHADER_330: &'static str = r"
#version 330
out vec4 out_color;
uniform sampler2D s_texture;
in vec2 v_tex_coord;
in vec3 v_color;
void main() {
out_color = texture(s_texture, v_tex_coord) * vec4(v_color, 1.0);
}
";
program.bind_frag(0, "out_color");
program.bind();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment