Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / games / voxels / src / main / rust / shaders / entity.vert

entity.vert36 lines · 843 BRaw
1#version 450
2layout(location=0) in vec3 inPos;
3layout(location=1) in vec2 inUv;
4layout(location=2) in vec3 inColor;
5layout(location=3) in float inAo;
6layout(location=4) in float inTileIdx;
7layout(location=5) in vec3 inNormal;
8
9layout(binding=0) uniform Ubo {
10 mat4 viewProj;
11 vec3 sunDir;
12 float time;
13 vec3 fogColor;
14 float fogDensity;
15 vec4 playerPos;
16 float dayFactor;
17 mat4 invViewProj;
18 vec3 sunColor;
19 float cloudShadow;
20 vec3 ambientColor;
21 float _pad2;
22 mat4 lightViewProj;
23};
24
25layout(location=0) out vec2 fragUv;
26layout(location=1) out vec3 fragColor;
27layout(location=2) out vec3 fragWorldPos;
28layout(location=3) out vec3 fragNormal;
29
30void main() {
31 gl_Position = viewProj * vec4(inPos, 1.0);
32 fragUv = inUv;
33 fragColor = inColor;
34 fragWorldPos = inPos;
35 fragNormal = inNormal;
36}