Zbuf-selection fix: while drawing vertices, it accepted writing in zbuf
for it too... giving (sometimes) no selection, and possible for linux the solution too!
This commit is contained in:
@@ -1118,6 +1118,8 @@ static void draw_vertices(short sel)
|
||||
/* if not V3D_ZBUF_SELECT: */
|
||||
/* draws in zbuffer mode twice, to show invisible vertices transparent */
|
||||
|
||||
if(G.zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select
|
||||
|
||||
size= BIF_GetThemeValuef(TH_VERTEX_SIZE);
|
||||
fsize= BIF_GetThemeValuef(TH_FACEDOT_SIZE);
|
||||
if(sel) {
|
||||
@@ -1228,6 +1230,7 @@ static void draw_vertices(short sel)
|
||||
bglEnd();
|
||||
}
|
||||
|
||||
if(G.zbuf) glDepthMask(1);
|
||||
glPointSize(1.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,9 +270,11 @@ void init_gl_stuff(void)
|
||||
glPixelTransferi(GL_BLUE_BIAS, 0);
|
||||
glPixelTransferi(GL_ALPHA_SCALE, 1);
|
||||
glPixelTransferi(GL_ALPHA_BIAS, 0);
|
||||
|
||||
glPixelTransferi(GL_DEPTH_BIAS, 0);
|
||||
glPixelTransferi(GL_DEPTH_SCALE, 1);
|
||||
|
||||
glDepthRange(0.0, 1.0);
|
||||
|
||||
a= 0;
|
||||
for(x=0; x<32; x++) {
|
||||
for(y=0; y<4; y++) {
|
||||
|
||||
@@ -135,7 +135,7 @@ int EM_zbuffer_visible(float *co, short xs, short ys)
|
||||
|
||||
glReadPixels(curarea->winrct.xmin+xs, curarea->winrct.ymin+ys, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &zval);
|
||||
|
||||
//printf("my proj %f zbuf %f mydiff %f\n", vec4[2], zval, vec4[2]-zval);
|
||||
// printf("my proj %f zbuf %f mydiff %f\n", vec4[2], zval, vec4[2]-zval);
|
||||
if( vec4[2] > zval) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user