Create basics source files
This commit is contained in:
parent
0d0652bbc0
commit
e29a9115d1
8 changed files with 477 additions and 0 deletions
29
resources/shaders/square.glsl
Normal file
29
resources/shaders/square.glsl
Normal file
|
@ -0,0 +1,29 @@
|
|||
// ----- Vertex Shader -----
|
||||
#version 330 core
|
||||
|
||||
layout(location = 0) in vec3 position;
|
||||
uniform mat4 projection;
|
||||
uniform mat4 model;
|
||||
|
||||
|
||||
void main(){
|
||||
|
||||
gl_Position = projection * model * vec4(position,1);
|
||||
|
||||
}
|
||||
|
||||
// ----- Fragment Shader -----
|
||||
|
||||
#version 330 core
|
||||
|
||||
uniform vec2 resolution;
|
||||
uniform float time;
|
||||
|
||||
out vec3 color;
|
||||
|
||||
void main(){
|
||||
vec2 coord=gl_FragCoord.xy/resolution;
|
||||
coord-=0.5;
|
||||
float d=length(coord);
|
||||
color=vec3(d,1,1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue