summaryrefslogtreecommitdiffstats
path: root/cwd/shaders
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-26 16:11:17 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-26 16:11:17 +0200
commit8ac4fe6d5ba5091923c7fdf1fa88724d827706fa (patch)
treea4ce203f671f9b8311d09dd36f1f80ae65799a56 /cwd/shaders
parent2017-05-21 (diff)
downloadAltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.gz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.bz2
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.lz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.xz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.zst
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.zip
Diffstat (limited to 'cwd/shaders')
-rw-r--r--cwd/shaders/block.fs16
-rw-r--r--cwd/shaders/block.vs15
-rw-r--r--cwd/shaders/simple.fs15
-rw-r--r--cwd/shaders/simple.vs16
4 files changed, 62 insertions, 0 deletions
diff --git a/cwd/shaders/block.fs b/cwd/shaders/block.fs
new file mode 100644
index 0000000..e239f7b
--- /dev/null
+++ b/cwd/shaders/block.fs
@@ -0,0 +1,16 @@
+#version 330 core
+in vec2 TexCoord;
+
+uniform sampler2D textureAtlas;
+uniform int block;
+
+vec4 GetTextureByBlockId(int BlockId) {
+ return vec4(0,0,0,0);
+}
+
+void main()
+{
+ vec4 TextureCoords = GetTextureByBlockId(block);
+ gl_FragmentColor = texture(blockTexture,TexCoord);
+}
+
diff --git a/cwd/shaders/block.vs b/cwd/shaders/block.vs
new file mode 100644
index 0000000..7a36a5d
--- /dev/null
+++ b/cwd/shaders/block.vs
@@ -0,0 +1,15 @@
+#version 330 core
+layout (location = 0) in vec3 position;
+layout (location = 2) in vec2 UvCoordinates;
+
+out vec2 UvPosition;
+
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
+
+void main()
+{
+ gl_Position = projection * view * model * vec4(position, 1.0f);
+ UvPosition = vec2(UvCoordinates.x,UvCoordinates.y);
+} \ No newline at end of file
diff --git a/cwd/shaders/simple.fs b/cwd/shaders/simple.fs
new file mode 100644
index 0000000..cc7f812
--- /dev/null
+++ b/cwd/shaders/simple.fs
@@ -0,0 +1,15 @@
+#version 330 core
+in vec2 TexCoord;
+
+out vec4 color;
+
+uniform sampler2D blockTexture;
+uniform int block;
+uniform float time;
+
+void main()
+{
+ color = texture(blockTexture,TexCoord);
+ //color = vec4(TexCoord.x,TexCoord.y,0.0,1.0);
+}
+
diff --git a/cwd/shaders/simple.vs b/cwd/shaders/simple.vs
new file mode 100644
index 0000000..ca99e85
--- /dev/null
+++ b/cwd/shaders/simple.vs
@@ -0,0 +1,16 @@
+#version 330 core
+layout (location = 0) in vec3 position;
+layout (location = 2) in vec2 texCoord;
+
+out vec2 TexCoord;
+
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
+
+void main()
+{
+ gl_Position = projection * view * model * vec4(position, 1.0f);
+ TexCoord = vec2(texCoord.x, texCoord.y);
+ //TexCoord = texCoord;
+} \ No newline at end of file