summaryrefslogtreecommitdiff
path: root/src/common/overlay/assets/shaders/scene/vert.glsl
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-01-28 12:03:11 -0500
committerLLLL Colonq <llll@colonq>2025-01-28 12:03:11 -0500
commit23d651bbad510f14484cf1c0a8081ffff890565e (patch)
tree3645723cb9383bcf8ea3733d50d76ba1fe86e131 /src/common/overlay/assets/shaders/scene/vert.glsl
parentf448de77d84b985047a332150c0382adc1836899 (diff)
Working overlay
Diffstat (limited to 'src/common/overlay/assets/shaders/scene/vert.glsl')
-rw-r--r--src/common/overlay/assets/shaders/scene/vert.glsl18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/overlay/assets/shaders/scene/vert.glsl b/src/common/overlay/assets/shaders/scene/vert.glsl
new file mode 100644
index 0000000..64f400c
--- /dev/null
+++ b/src/common/overlay/assets/shaders/scene/vert.glsl
@@ -0,0 +1,18 @@
+in vec4 joint;
+in vec4 weight;
+
+uniform mat4 joint_matrices[128];
+
+void main()
+{
+ vertex_texcoord = texcoord;
+ vertex_normal = (normal_matrix * vec4(normal, 1.0)).xyz;
+ mat4 skin
+ = weight.x * joint_matrices[int(joint.x)]
+ + weight.y * joint_matrices[int(joint.y)]
+ + weight.z * joint_matrices[int(joint.z)]
+ + weight.w * joint_matrices[int(joint.w)];
+ vec3 pos = (position * skin * vec4(vertex, 1.0)).xyz;
+ vertex_view_vector = camera_pos - pos;
+ gl_Position = projection * view * vec4(pos, 1.0);
+}