summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-09-23 12:12:30 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-09-23 12:14:50 -0300
commit65fd37c14947bd596510fb764de649927e1b18f4 (patch)
tree8d9b9b9033fedf5f03634b972527e6ce8c844ccf /scene
parent7e3ce79ea9aaa30bad17d6373b5945083cb59209 (diff)
-Rewrote GLES2 lighting and shadows and optimized state changes, did many optimizations, added vertex lighting.
-Did some fixes to GLES3 too
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/material.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 2cf802a2da..cc8685b952 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -562,7 +562,9 @@ void SpatialMaterial::_update_shader() {
if (flags[FLAG_SRGB_VERTEX_COLOR]) {
- code += "\tCOLOR.rgb = mix( pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb* (1.0 / 12.92), lessThan(COLOR.rgb,vec3(0.04045)) );\n";
+ code += "\tif (!OUTPUT_IS_SRGB) {\n";
+ code += "\t\tCOLOR.rgb = mix( pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb* (1.0 / 12.92), lessThan(COLOR.rgb,vec3(0.04045)) );\n";
+ code += "\t}\n";
}
if (flags[FLAG_USE_POINT_SIZE]) {