Debian Codegraph @

libs/opengl/shaders/textured-triangles-light.v.glsl

raw
1 R"XXX(#version 300 es
2
3 // VERTEX SHADER: Default shader for MRPT CRenderizable objects
4 // Jose Luis Blanco Claraco (C) 2019-2023
5 // Part of the MRPT project
6
7
8 in vec3 position;
9 in vec2 vertexUV;
10 in vec3 vertexNormal;
11
12 uniform highp mat4 p_matrix;
13 uniform highp mat4 v_matrix;
14 uniform highp mat4 m_matrix;
15
16 out highp vec3 frag_position, frag_normal;
17 out mediump vec2 frag_UV; // Interpolated UV texture coords
18
19 void main()
20 {
21 frag_UV = vertexUV;
22
23 frag_position = vec3(m_matrix * vec4(position, 1.0));
24 frag_normal = normalize(mat3(m_matrix) * vertexNormal);
25
26 gl_Position = p_matrix * v_matrix * vec4(frag_position, 1.0);
27 }
28
29 )XXX"