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:
authorTon Roosendaal <ton@blender.org>2005-11-28 02:27:14 +0300
committerTon Roosendaal <ton@blender.org>2005-11-28 02:27:14 +0300
commit1745a077ad78752cb40afb06b70111d668f843d2 (patch)
tree7408944001cf97d6d000cfa5bd7a5d37eb6894d6 /source/blender
parentea1df5652d97a0487923705ff169ce6ccefc629a (diff)
New object centers were not visible consistantly when using zbuffering.
Instead of disabling zbuffer while drawing it, it now still writes zvalues, but not tests for it. That way the centers are visible independent of drawing order.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/src/drawobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 2e3c87660eb..c78e4c53859 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -288,7 +288,8 @@ static void drawcentercircle(float *vec, int selstate, int special_color)
size= v3d->persmat[0][3]*vec[0]+ v3d->persmat[1][3]*vec[1]+ v3d->persmat[2][3]*vec[2]+ v3d->persmat[3][3];
size*= v3d->pixsize*((float)U.obcenter_dia*0.5f);
- if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
+ /* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */
+ if(v3d->zbuf) glDepthFunc(GL_ALWAYS);
glEnable(GL_BLEND);
if(special_color) {
@@ -306,7 +307,7 @@ static void drawcentercircle(float *vec, int selstate, int special_color)
drawcircball(GL_LINE_LOOP, vec, size, v3d->viewinv);
glDisable(GL_BLEND);
- if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if(v3d->zbuf) glDepthFunc(GL_LEQUAL);
}