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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-06-16 09:50:13 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-06-16 09:50:13 +0400
commit17ee056fc6d15abc4b69a24ceac0e7f3d4dffa47 (patch)
tree23d28adc5ce3d24da631131bd1255410d0df23b5 /source/blender/gpu/intern
parent32c7e22d3696e3575f4b7d05c1f7140591e88809 (diff)
parent2e8ca6d1965bdcaaab672561aa2deddaf6b8f8b3 (diff)
Merged changes in the trunk up to revision 37539.
Conflicts resolved: source/blender/render/intern/source/pipeline.c Also fixed an inconsistent conflict resolution in the last commit with regard to release/scripts/startup/bl_ui/properties_render.py. This problem resulted in empty menus in the GUI.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 7dfbc52819e..87d25ac850a 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -246,8 +246,9 @@ static struct GPUTextureState {
int domipmap, linearmipmap;
int alphamode;
+ float anisotropic;
MTFace *lasttface;
-} GTS = {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, 0, -1, NULL};
+} GTS = {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, 0, -1, 1.f, NULL};
/* Mipmap settings */
@@ -292,6 +293,26 @@ static GLenum gpu_get_mipmap_filter(int mag)
}
}
+/* Anisotropic filtering settings */
+void GPU_set_anisotropic(float value)
+{
+ if (GTS.anisotropic != value)
+ {
+ GPU_free_images();
+
+ /* Clamp value to the maximum value the graphics card supports */
+ if (value > GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)
+ value = GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT;
+
+ GTS.anisotropic = value;
+ }
+}
+
+float GPU_get_anisotropic()
+{
+ return GTS.anisotropic;
+}
+
/* Set OpenGL state for an MTFace */
static void gpu_make_repbind(Image *ima)
@@ -559,6 +580,8 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
ima->tpageflag |= IMA_MIPMAP_COMPLETE;
}
+ if (GLEW_EXT_texture_filter_anisotropic)
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, GPU_get_anisotropic());
/* set to modulate with vertex color */
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);