Small program to quickly test OpenGL GLSL shaders.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
542 B (Stored with Git LFS)

#version 330 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec3 uv;
out vec3 frag_vertex;
out vec3 frag_normal;
layout (std140) uniform matrices
{
mat4 view_xform;
mat4 proj_xform;
mat4 normal_xform;
};
uniform mat4 model_xform;
void main()
{
//mat4 xform = model_xform;
//frag_normal = normalize(xform * vec4(normal, 1)).xyz;
frag_normal = normalize(normal);
gl_Position = proj_xform * view_xform * model_xform * vec4(position, 1);
frag_vertex = gl_Position.xyz;
}