diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2020-07-05 18:55:39 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2020-07-05 18:55:39 +0200 |
| commit | e29a9115d185d0b752868a36c8d56f6020bc4134 (patch) | |
| tree | d7d267d8578637714581f6758887945ae19fc15b /resources | |
| parent | 0d0652bbc07bc073ba1efabe865552d96c10104c (diff) | |
Create basics source files
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/shaders/square.glsl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/resources/shaders/square.glsl b/resources/shaders/square.glsl new file mode 100644 index 0000000..200215c --- /dev/null +++ b/resources/shaders/square.glsl @@ -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); +} |
