From 8803b10d6830c1dedd566b58473c07d975b0a964 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Fri, 28 Jan 2022 10:39:17 +0100 Subject: [PATCH] Added color shader --- core/assets/shader/color.fragment.glsl | 9 +++++++++ core/assets/shader/color.vertex.glsl | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 core/assets/shader/color.fragment.glsl create mode 100644 core/assets/shader/color.vertex.glsl diff --git a/core/assets/shader/color.fragment.glsl b/core/assets/shader/color.fragment.glsl new file mode 100644 index 00000000..4c993422 --- /dev/null +++ b/core/assets/shader/color.fragment.glsl @@ -0,0 +1,9 @@ +#ifdef GL_ES +precision mediump float; +#endif + +uniform vec4 u_color; + +void main() { + gl_FragColor = vec4(u_color); +} diff --git a/core/assets/shader/color.vertex.glsl b/core/assets/shader/color.vertex.glsl new file mode 100644 index 00000000..39271bd7 --- /dev/null +++ b/core/assets/shader/color.vertex.glsl @@ -0,0 +1,10 @@ +attribute vec3 a_position; +attribute vec3 a_normal; +attribute vec2 a_texCoord0; + +uniform mat4 u_worldTrans; +uniform mat4 u_projTrans; + +void main() { + gl_Position = u_projTrans * u_worldTrans * vec4(a_position, 1.0); +}