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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-12-03 02:38:29 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-12-03 19:19:11 +0300
commit82f01c666f24e52b09be159c764131c19a9d4d75 (patch)
tree75d13797752512bc38b17a4636804946cc44b576 /source
parent24fd03d0c2fc5f49bc3813afce7ac5d67fc762bd (diff)
View3D: Grid: Don't make the Zaxis produce any fragment is not needed
This was a bug that was making the grid drawing even more slower than it is.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/modes/shaders/object_grid_vert.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/modes/shaders/object_grid_vert.glsl b/source/blender/draw/modes/shaders/object_grid_vert.glsl
index a346973a597..15b37bb289d 100644
--- a/source/blender/draw/modes/shaders/object_grid_vert.glsl
+++ b/source/blender/draw/modes/shaders/object_grid_vert.glsl
@@ -53,10 +53,10 @@ void main()
/* Used for additional Z axis */
if ((gridFlag & CLIP_Z_POS) != 0) {
- realPos.z = max(realPos.z, 0.0);
+ realPos.z = clamp(realPos.z, 0.0, 1e30);
}
if ((gridFlag & CLIP_Z_NEG) != 0) {
- realPos.z = min(-realPos.z, 0.0);
+ realPos.z = clamp(realPos.z, -1e30, 0.0);
}
gl_Position = ViewProjectionMatrix * vec4(realPos, 1.0);