From 73e62dffb909fcf47be23d4fa056e9039b7e561f Mon Sep 17 00:00:00 2001 From: jfons Date: Fri, 29 Jan 2021 16:12:50 +0100 Subject: 3D editor grid improvements This commit adds a view-dependant fade to the 3D viewport grid. It fades out at steep view angles to hide the solid regions that appear far from the camera. I also included a fade to hide the grid borders. I added some improvements to the dynamic grid when the camera is in orthogonal mode. It properly handles zoom now, and the grid center is now set to the intersection point between the grid plane and the camera forward ray, keeping the grid always visible. --- scene/resources/material.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 445c0d9677..92d2fb1c6d 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -735,7 +735,7 @@ void BaseMaterial3D::_update_shader() { if (flags[FLAG_SRGB_VERTEX_COLOR]) { 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\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]) { -- cgit v1.2.3