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:
authorCampbell Barton <ideasman42@gmail.com>2007-10-20 22:01:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-10-20 22:01:57 +0400
commit960eaed6cd42a58785de0666ac219ef9bf7238b5 (patch)
tree76843efe82d3d839ff16840d42a7a7f85037f4d5 /source/blender
parentbfbb35004099f7c6f204ab24a7a2bf58f5673e73 (diff)
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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1
-rw-r--r--source/blender/src/drawmesh.c4
-rw-r--r--source/blender/src/space.c7
3 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index b4436dc69b2..e0752ae1781 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -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 !!!! */
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c
index 6fbd0c71997..36bad20d9f9 100644
--- a/source/blender/src/drawmesh.c
+++ b/source/blender/src/drawmesh.c
@@ -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);
}
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 4d81d6bd232..559c74b7995 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -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)");