summaryrefslogtreecommitdiff
path: root/source/Asura.Editor/Graphics/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'source/Asura.Editor/Graphics/shaders')
-rw-r--r--source/Asura.Editor/Graphics/shaders/image.shader.h35
-rw-r--r--source/Asura.Editor/Graphics/shaders/polygon.shader.h29
2 files changed, 64 insertions, 0 deletions
diff --git a/source/Asura.Editor/Graphics/shaders/image.shader.h b/source/Asura.Editor/Graphics/shaders/image.shader.h
new file mode 100644
index 0000000..cbdd542
--- /dev/null
+++ b/source/Asura.Editor/Graphics/shaders/image.shader.h
@@ -0,0 +1,35 @@
+#ifndef _ASURA_EDITOR_SHADER_H_
+#include "../shader.h"
+#endif
+
+//
+static AsuraEditor::Graphics::ShaderProgram image_shader =
+{
+R"(
+in vec2 asura_position;
+in vec2 asura_texcoord0;
+
+uniform mat4 asura_model_matrix;
+uniform mat4 asura_view_matrix;
+uniform mat4 asura_projection_matrix;
+
+void main()
+{
+ gl_Position = asura_projection_matrix * asura_view_matrix * asura_model_matrix * vec4(asura_position, 0, 1);
+ uv = asura_texcoord0;
+}
+
+)",
+
+R"(
+in vec2 uv;
+
+uniform sampler2D asura_maintex;
+
+void main()
+{
+
+}
+
+)"
+}; \ No newline at end of file
diff --git a/source/Asura.Editor/Graphics/shaders/polygon.shader.h b/source/Asura.Editor/Graphics/shaders/polygon.shader.h
new file mode 100644
index 0000000..a92e9a6
--- /dev/null
+++ b/source/Asura.Editor/Graphics/shaders/polygon.shader.h
@@ -0,0 +1,29 @@
+#ifndef _ASURA_EDITOR_SHADER_H_
+#include "../shader.h"
+#endif
+
+//
+static AsuraEditor::Graphics::ShaderProgram polygon_shader =
+{
+ R"(
+in vec2 position;
+
+uniform mat4 mvp_matrix;
+
+void main()
+{
+ gl_Position = mvp_matrix * vec4(position, 0, 1);
+}
+
+)",
+
+R"(
+uniform vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+)"
+}; \ No newline at end of file