summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
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]) {