KP3Dii/Data/resources/shaders/.kp3d/wireframe_v.glsl

27 lines
495 B
Text
Raw Normal View History

2024-07-22 07:48:42 +00:00
#version 330 core
uniform mat4 u_mvp;
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 texcoord;
out vec3 v_position;
out vec3 v_normal;
out vec2 v_texcoord;
out float v_id;
void main()
{
v_position = position;
v_normal = normal;
v_texcoord = texcoord;
// Push out each vertex just a bit, sort of like `glPolygonOffset()`
v_position += v_normal * 0.005f;
v_id = gl_VertexID;
gl_Position = u_mvp * vec4(v_position, 1.0);
}