summaryrefslogtreecommitdiffstats
path: root/cwd/shaders/block.vs
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-14 16:22:52 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-14 16:22:52 +0200
commitac8905602d1f221a71ddcdc86796344101276321 (patch)
tree21deaeb615d6789e7ddf14844cbf8faf0081af7e /cwd/shaders/block.vs
parent2017-06-07 (diff)
downloadAltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar.gz
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar.bz2
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar.lz
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar.xz
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.tar.zst
AltCraft-ac8905602d1f221a71ddcdc86796344101276321.zip
Diffstat (limited to 'cwd/shaders/block.vs')
-rw-r--r--cwd/shaders/block.vs15
1 files changed, 13 insertions, 2 deletions
diff --git a/cwd/shaders/block.vs b/cwd/shaders/block.vs
index e8756c0..6c45c24 100644
--- a/cwd/shaders/block.vs
+++ b/cwd/shaders/block.vs
@@ -1,18 +1,29 @@
#version 330 core
layout (location = 0) in vec3 position;
layout (location = 2) in vec2 UvCoordinates;
+layout (location = 7) in vec2 BlockId;
+layout (location = 8) in mat4 model;
+//layout (location = 12) in something....
out vec2 UvPosition;
out vec3 FragmentPosition;
+flat out int Block;
+flat out int State;
+out vec4 ndcPos;
uniform mat4 view;
uniform mat4 projection;
uniform float time;
-uniform mat4 model;
void main()
{
- gl_Position = projection * view * model * vec4(position, 1.0f);
UvPosition = vec2(UvCoordinates.x,UvCoordinates.y);
FragmentPosition = position;
+ Block = int(BlockId.x);
+ State = int(BlockId.y);
+
+ vec4 sourcePosition = vec4(position,1.0f);
+ ndcPos = (projection*view*model) * sourcePosition;
+ gl_Position = projection * view * model * sourcePosition;
+
}