Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic infinite 3D grid #28289

Merged
merged 1 commit into from
May 26, 2020
Merged

Dynamic infinite 3D grid #28289

merged 1 commit into from
May 26, 2020

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Apr 22, 2019

Fixes #7245, EDIT: Also fixes #37561, needs testing and feedback. What this PR does:

  • The grid is now infinite, it follows the camera.

  • The grid is now dynamic, if you zoom in and out, the grid subdivides, expands, and fades.

  • You can now enable grid planes for the XY and YZ planes. Only the flat XZ plane is enabled by default. Each plane is independently dynamic of the others.

  • The default grid size has been increased to 200, and the maximum has been increased to 2000. At 1000, the grid mostly looks edgeless.

(slightly outdated) video demo: https://www.youtube.com/watch?v=k28f3QjaW6o

Untitled

  • If you set the division level max and min to the same value then the grid does not expand or subdivide, but instead stays the same size and just follows the camera. Also, if these values are the same, the bias value does nothing.

  • If you want to have Blender-like behavior, set max to 1, min to 0, and set the bias to a really low value. You may also wish to increase the grid size if you have a small bias.

Also, a future enhancement idea, it would be nice if there was a way to fade the grid with distance. Right now I have an effect where the grid lines individually fade based on distance, but it is sub-par since lines that come near the camera are still fully opaque even when far away, and also there's no way to make the grid gradually fade, right now it only fades in steps when you zoom. #12324

@MarcusElg
Copy link
Contributor

This feels like a quite important feature so how is it going?

@lentsius-bark
Copy link
Contributor

Happened to pass by this and it indeed would be an awesome feature! Any news on it?

@MarcusElg
Copy link
Contributor

Even blender 2.8 has it now :P

@MarcusElg
Copy link
Contributor

@aaronfranke Any update? What's left?

@aaronfranke
Copy link
Member Author

@MCrafterzz I took another look at it, and I think it's good now. Everything seems to work great.

@MarcusElg
Copy link
Contributor

MarcusElg commented Mar 27, 2020

@MCrafterzz I took another look at it, and I think it's good now. Everything seems to work great.

Thanks, infinite grid is a really nice feature to have! Can someone review this then?

@Calinou
Copy link
Member

Calinou commented May 22, 2020

I tested this PR locally, it looks great!

I wonder if we should make the default grid colors less opaque. Right now, it stands out quite a lot in a dark environment:

image

Here's with both grid colors having their opacity halved:

image

editor/editor_settings.cpp Outdated Show resolved Hide resolved
editor/editor_settings.cpp Outdated Show resolved Hide resolved
editor/editor_settings.cpp Outdated Show resolved Hide resolved
editor/editor_settings.cpp Outdated Show resolved Hide resolved
editor/editor_settings.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
Well, infinite for all intents and purposes.
@aaronfranke
Copy link
Member Author

aaronfranke commented May 22, 2020

@Calinou Good suggestions! It looks great with half opacity, and I don't know what I was thinking with the comments being on the end of such long lines.

EDIT: Oh, I made the changes and forgot to push them, whoops. They're pushed now...

@akien-mga
Copy link
Member

Thanks!

@aaronfranke aaronfranke deleted the grid branch May 26, 2020 12:48
@Calinou
Copy link
Member

Calinou commented May 31, 2020

Would it be possible to make a PR with this feature for the 3.2 branch? Everything should be feasible there, except for the transparent grid part (unless we can figure out a way to make it work there).

3.2.2 is nearing release, but we could get this feature into 3.2.3.

@FyiurAmron
Copy link

FyiurAmron commented Oct 3, 2020

@Calinou any news on when do this can possibly be released?

@Calinou
Copy link
Member

Calinou commented Oct 3, 2020

@FyiurAmron This feature is already available in the master branch, but nobody has started work on remaking this for the 3.2 branch yet.

@yikescloud
Copy link

I think if we can see the grid when on orthogonal sideview will be useful!

@aaronfranke
Copy link
Member Author

@firecloud888 You already can:

Screenshot from 2021-02-14 08-35-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3D Grid Color Picker missing Alpha / Opacity setting Make the 3D grid in the editor infinite
8 participants