1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

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.

(cherry picked from commit 73e62dffb9)
This commit is contained in:
jfons
2021-01-29 16:12:50 +01:00
committed by Rémi Verschelde
parent 56535539d4
commit 16bbe8ddf4
3 changed files with 132 additions and 65 deletions

View File

@@ -574,7 +574,6 @@ private:
/////
ToolMode tool_mode;
bool orthogonal;
VisualServer::ScenarioDebugMode scenario_debug;
@@ -607,6 +606,7 @@ private:
RID cursor_mesh;
RID cursor_instance;
Ref<SpatialMaterial> indicator_mat;
Ref<ShaderMaterial> grid_mat[3];
Ref<SpatialMaterial> cursor_material;
// Scene drag and drop support