added an option to adjust the alpha clipping value in the oprnGL preferenes. in some cases you might

want to use 0.5 to see through more of the texture. (less halo's with clipmaps), defailt is 0.0 so it 
will only clip 0 alpha.
This commit is contained in:
2007-10-20 18:01:57 +00:00
parent bfbb350040
commit 960eaed6cd
3 changed files with 9 additions and 3 deletions

View File

@@ -182,6 +182,7 @@ typedef struct UserDef {
short recent_files; /* maximum number of recently used files to remember */
short smooth_viewtx; /* miliseconds to spend spinning the view */
short glreslimit;
float glalphaclip;
} UserDef;
extern UserDef U; /* from usiblender.c !!!! */

View File

@@ -242,7 +242,7 @@ int set_tpage(MTFace *tface)
/* added after 2.45 to clip alpha */
glEnable ( GL_ALPHA_TEST );
glAlphaFunc ( GL_GREATER, 0.001 );
glAlphaFunc ( GL_GREATER, U.glalphaclip );
/* glBlendEquationEXT(GL_FUNC_ADD_EXT); */
@@ -960,7 +960,7 @@ static void draw_textured_begin(Object *ob)
Gtexdraw.istex = istex;
memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0);
glDisable ( GL_ALPHA_TEST );
glShadeModel(GL_SMOOTH);
}

View File

@@ -3865,8 +3865,13 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&(U.uiflag), 0, 0, 0, 0, "Hide files/datablocks that start with a dot(.*)");
uiDefBut(block, LABEL,0,"OpenGL:",
(xpos+edgsp+(5*midsp)+(5*mpref)),y6label,mpref,buth,
(xpos+edgsp+(5*midsp)+(5*mpref)),y7label,mpref,buth,
0, 0, 0, 0, 0, "");
uiDefButF(block, NUMSLI, B_DRAWINFO, "Clip Alpha: ",
(xpos+edgsp+(5*mpref)+(5*midsp)),y6,mpref,buth,
&(U.glalphaclip), 0.0, 1.0, 0, 0, "Clip alpha below this threshold in the 3d textured view");
uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps",
(xpos+edgsp+(5*mpref)+(5*midsp)),y5,mpref,buth,
&(U.gameflags), 0, 0, 0, 0, "Toggles between mipmap textures on (beautiful) and off (fast)");