Files
tactileipc3d/shaders/panel.vert
2025-12-18 09:19:39 +08:00

19 lines
633 B
GLSL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#version 330 core
// 顶点输入(来自 VBO
layout(location=0) in vec3 aPos; // 顶点位置(当前我们直接当作“世界坐标”来用)
layout(location=1) in vec3 aN; // 法线(当前没用到,先保留)
// uMVP = Projection * View * Model
// 把顶点从“世界坐标”变换到“裁剪空间clip spaceOpenGL 用 gl_Position 来完成屏幕投影
out vec3 vWorldPos;
out vec3 vWorldNormal;
uniform mat4 uMVP;
void main() {
// Model is identity in this project; treat vertex data as world space.
vWorldPos = aPos;
vWorldNormal = aN;
gl_Position = uMVP * vec4(aPos, 1.0);
}