diff options
author | jfons <joan.fonssanchez@gmail.com> | 2021-01-29 16:12:50 +0100 |
---|---|---|
committer | jfons <joan.fonssanchez@gmail.com> | 2021-02-01 22:19:54 +0100 |
commit | 73e62dffb909fcf47be23d4fa056e9039b7e561f (patch) | |
tree | 018eef6473d004aac5cff523431da21a9046db7f /scene | |
parent | 46de553473b4bea49176fb4316176a5662931160 (diff) |
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.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/material.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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]) { |