Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-10-30 18:44:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-30 18:44:23 +0300
commit87f4c830180d0590c62eece483f2231e01dea4b2 (patch)
tree9981efac7ccffbcd2b4806960841551c474f766e /source/blender
parentc4f69794ca14e3c38ea8558c8a5414df2a778e19 (diff)
Object Mode: Grid: Allow more subdivision in orthographic views
2.7x was displaying 2 additional subdivision for theses views. Bumping to 3 just to say we improved it! Hypothetically it can be increased as much as we want but float precision can quickly become an issue.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/draw/modes/object_mode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index b494fbc740e..472de8ba47f 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -502,6 +502,11 @@ static void OBJECT_engine_init(void *vedata)
}
else {
+ if (rv3d->view != RV3D_VIEW_USER) {
+ /* Allow 3 more subdivisions. */
+ grid_scale /= powf(v3d->gridsubdiv, 3);
+ }
+
float viewdist = 1.0f / max_ff(fabsf(winmat[0][0]), fabsf(winmat[1][1]));
grid_res = viewdist / grid_scale;