2021-07-09 17:05:27 +00:00
|
|
|
#version 120
|
|
|
|
|
2023-02-25 19:03:39 +00:00
|
|
|
#include "lib/core/vertex.h.glsl"
|
2021-07-09 17:05:27 +00:00
|
|
|
|
2022-08-31 19:11:52 +00:00
|
|
|
uniform vec3 color;
|
|
|
|
uniform vec3 trans;
|
|
|
|
uniform vec3 scale;
|
2022-09-02 11:40:41 +00:00
|
|
|
uniform bool useNormalAsColor;
|
|
|
|
uniform bool useAdvancedShader = false;
|
2022-08-31 19:11:52 +00:00
|
|
|
|
2021-08-08 01:04:11 +00:00
|
|
|
centroid varying vec4 passColor;
|
2022-08-31 19:11:52 +00:00
|
|
|
varying vec3 vertexNormal;
|
2021-07-09 17:05:27 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2022-09-02 11:40:41 +00:00
|
|
|
if(!useAdvancedShader)
|
2022-08-31 19:11:52 +00:00
|
|
|
{
|
2023-02-25 19:03:39 +00:00
|
|
|
gl_Position = modelToClip( vec4(gl_Vertex));
|
2022-08-31 19:11:52 +00:00
|
|
|
vertexNormal = vec3(1., 1., 1.);
|
|
|
|
passColor = gl_Color;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-25 19:03:39 +00:00
|
|
|
gl_Position = modelToClip( vec4(gl_Vertex.xyz * scale + trans,1));
|
2022-09-02 11:40:41 +00:00
|
|
|
|
|
|
|
vertexNormal = useNormalAsColor ? vec3(1., 1., 1.) : gl_Normal.xyz;
|
|
|
|
vec3 colorOut = useNormalAsColor? gl_Normal.xyz : color;
|
2022-08-31 19:11:52 +00:00
|
|
|
passColor = vec4(colorOut, 1.);
|
|
|
|
}
|
|
|
|
|
2021-07-09 17:05:27 +00:00
|
|
|
}
|