Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
3e5581c366

+ 4 - 0
panda/src/glgsg/config_glgsg.cxx

@@ -31,6 +31,10 @@ bool gl_cull_traversal = config_glgsg.GetBool("gl-cull-traversal", true);
 // renderer.
 bool gl_ignore_mipmaps = config_glgsg.GetBool("gl-ignore-mipmaps", false);
 
+// Configure this true to enable full trilinear mipmapping on every
+// texture, whether it asks for it or not.
+bool gl_force_mipmaps = config_glgsg.GetBool("gl-force-mipmaps", false);
+
 // Configure this true to cause mipmaps to be rendered with phony
 // colors, using mipmap_level_*.rgb if they are available.
 bool gl_show_mipmaps = config_glgsg.GetBool("gl-show-mipmaps", false);

+ 1 - 0
panda/src/glgsg/config_glgsg.h

@@ -15,6 +15,7 @@ extern bool gl_show_transforms;
 extern bool gl_cheap_textures;
 extern bool gl_cull_traversal;
 extern bool gl_ignore_mipmaps;
+extern bool gl_force_mipmaps;
 extern bool gl_show_mipmaps;
 
 // Ways to implement decals.

+ 14 - 6
panda/src/glgsg/glGraphicsStateGuardian.cxx

@@ -3382,10 +3382,18 @@ specify_texture(Texture *tex) {
 		  get_texture_wrap_mode(tex->get_wrapu()));
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
 		  get_texture_wrap_mode(tex->get_wrapv()));
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
-		  get_texture_filter_type(tex->get_minfilter()));
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
-		  get_texture_filter_type(tex->get_magfilter()));
+
+  if (gl_force_mipmaps) {
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
+		    GL_LINEAR_MIPMAP_LINEAR);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+  } else {
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
+		    get_texture_filter_type(tex->get_minfilter()));
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
+		    get_texture_filter_type(tex->get_magfilter()));
+  }
 }
 
 
@@ -3411,7 +3419,7 @@ apply_texture_immediate(Texture *tex) {
     << (int)type << ", " << tex->get_name() << ")\n";
 #endif
 
-  if (!gl_ignore_mipmaps) {
+  if (!gl_ignore_mipmaps || gl_force_mipmaps) {
     bool use_mipmaps;
     switch (tex->get_minfilter()) {
     case Texture::FT_nearest_mipmap_nearest:
@@ -3425,7 +3433,7 @@ apply_texture_immediate(Texture *tex) {
       use_mipmaps = false;
       break;
     }
-    if (use_mipmaps) {
+    if (use_mipmaps || gl_force_mipmaps) {
 #ifndef NDEBUG
       if (gl_show_mipmaps) {
 	build_phony_mipmaps(tex);

+ 3 - 1
panda/src/gsgbase/graphicsStateGuardianBase.h

@@ -168,10 +168,12 @@ public:
   virtual void begin_decal(GeomNode *) { }
   virtual void end_decal(GeomNode *) { }
 
-public:
+PUBLISHED:
   static TypeHandle get_class_type() {
     return _type_handle;
   }
+
+public:
   static void init_type() {
     TypedReferenceCount::init_type();
     register_type(_type_handle, "GraphicsStateGuardianBase",