Debian Codegraph @

libs/opengl/shaders/textured-triangles-shadow-2nd.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 uniform highp mat4 light_pv_matrix; // =p*v matrices
16
17 out highp vec3 frag_position, frag_normal;
18 out mediump vec2 frag_UV; // Interpolated UV texture coords
19 out highp vec4 frag_posLightSpace;
20
21 void main()
22 {
23 highp vec4 vPos = m_matrix * vec4(position, 1.0);
24 frag_position = vec3(vPos);
25 frag_normal = normalize(mat3(m_matrix) * vertexNormal);
26 frag_UV = vertexUV;
27
28 frag_posLightSpace = light_pv_matrix * vPos;
29 gl_Position = p_matrix * v_matrix * vPos;
30 }
31 )XXX"