diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-20 16:25:21 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-20 16:25:21 +0200 |
commit | ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1 (patch) | |
tree | 3d3308541e5350d4639e217cb519fe55a34f6c45 /cwd/shaders/block.vs | |
parent | 2017-06-17 (diff) | |
download | AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar.gz AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar.bz2 AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar.lz AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar.xz AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.tar.zst AltCraft-ba2e09672bf88ed1016fc82bd88ac87df0a5b3a1.zip |
Diffstat (limited to 'cwd/shaders/block.vs')
-rw-r--r-- | cwd/shaders/block.vs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cwd/shaders/block.vs b/cwd/shaders/block.vs index 6c45c24..457d5dd 100644 --- a/cwd/shaders/block.vs +++ b/cwd/shaders/block.vs @@ -5,11 +5,13 @@ 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; +out VS_OUT { + vec2 UvPosition; + vec3 FragmentPosition; + flat int Block; + flat int State; + vec4 ndcPos; +} vs_out; uniform mat4 view; uniform mat4 projection; @@ -17,13 +19,13 @@ uniform float time; void main() { - UvPosition = vec2(UvCoordinates.x,UvCoordinates.y); - FragmentPosition = position; - Block = int(BlockId.x); - State = int(BlockId.y); + vs_out.UvPosition = vec2(UvCoordinates.x,UvCoordinates.y); + vs_out.FragmentPosition = position; + vs_out.Block = int(BlockId.x); + vs_out.State = int(BlockId.y); vec4 sourcePosition = vec4(position,1.0f); - ndcPos = (projection*view*model) * sourcePosition; + vs_out.ndcPos = (projection*view*model) * sourcePosition; gl_Position = projection * view * model * sourcePosition; } |