summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDanila Shutov <dcbrwn2@gmail.com>2020-06-16 22:48:31 +0300
committerGitHub <noreply@github.com>2020-06-16 20:48:31 +0100
commit3a6dfda358112e2fb5d6f887a1a1e936eacddadd (patch)
tree340e1e0442ef8ba346b522580b2b6bee66246b30 /client
parent0a1181f7637adab6fe1ba5d3c09038912a06b37f (diff)
downloadminetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.tar.gz
minetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.tar.bz2
minetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.zip
Make shading of CAOs optional (#10033)
Diffstat (limited to 'client')
-rw-r--r--client/shaders/object_shader/opengl_vertex.glsl4
1 files changed, 4 insertions, 0 deletions
diff --git a/client/shaders/object_shader/opengl_vertex.glsl b/client/shaders/object_shader/opengl_vertex.glsl
index 59171145f..968a07e22 100644
--- a/client/shaders/object_shader/opengl_vertex.glsl
+++ b/client/shaders/object_shader/opengl_vertex.glsl
@@ -39,11 +39,15 @@ void main(void)
lightVec = sunPosition - worldPosition;
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
+#if (MATERIAL_TYPE == TILE_MATERIAL_PLAIN) || (MATERIAL_TYPE == TILE_MATERIAL_PLAIN_ALPHA)
+ vIDiff = 1.0;
+#else
// This is intentional comparison with zero without any margin.
// If normal is not equal to zero exactly, then we assume it's a valid, just not normalized vector
vIDiff = length(gl_Normal) == 0.0
? 1.0
: directional_ambient(normalize(gl_Normal));
+#endif
gl_FrontColor = gl_BackColor = gl_Color;
}