From 29339928d7a05ca11786885643631206a978655e Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 6 Jul 2020 07:17:09 +0200 Subject: Cleaning code --- resources/shaders/main.glsl | 26 ++++++++++++++++++++++++++ resources/shaders/square.glsl | 29 ----------------------------- 2 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 resources/shaders/main.glsl delete mode 100644 resources/shaders/square.glsl (limited to 'resources') diff --git a/resources/shaders/main.glsl b/resources/shaders/main.glsl new file mode 100644 index 0000000..7d4067a --- /dev/null +++ b/resources/shaders/main.glsl @@ -0,0 +1,26 @@ +// ----- 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); +} diff --git a/resources/shaders/square.glsl b/resources/shaders/square.glsl deleted file mode 100644 index 200215c..0000000 --- a/resources/shaders/square.glsl +++ /dev/null @@ -1,29 +0,0 @@ -// ----- 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); -} -- cgit v1.2.3