| 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 vec4 vertexColor; |
| 10 |
|
| 11 |
uniform highp mat4 p_matrix; |
| 12 |
uniform highp mat4 mv_matrix; |
| 13 |
uniform float vertexPointSize; |
| 14 |
uniform int enableVariablePointSize; // 0 or 1 |
| 15 |
uniform float variablePointSize_K, variablePointSize_DepthScale; |
| 16 |
|
| 17 |
out lowp vec4 frag_color; |
| 18 |
|
| 19 |
void main() |
| 20 |
{ |
| 21 |
highp vec4 eye_position = mv_matrix * vec4(position, 1.0); |
| 22 |
gl_Position = p_matrix * eye_position; |
| 23 |
if (enableVariablePointSize!=0) |
| 24 |
gl_PointSize = vertexPointSize + |
| 25 |
variablePointSize_K/(variablePointSize_DepthScale*abs(gl_Position.z) + 0.01); |
| 26 |
else |
| 27 |
gl_PointSize = vertexPointSize; |
| 28 |
|
| 29 |
frag_color = vertexColor; |
| 30 |
} |
| 31 |
)XXX" |