Browse Source

add some more cheap options

David Rose 22 years ago
parent
commit
714a109faf

+ 14 - 12
panda/src/glgsg/config_glgsg.cxx

@@ -27,23 +27,25 @@
 Configure(config_glgsg);
 NotifyCategoryDef(glgsg, ":display:gsg");
 
-// Configure this variable true to cause the GLGSG to show each
-// transform space it renders by drawing a little unit axis.  This
-// cannot be enabled when the player is compiled in NDEBUG mode.
-bool gl_show_transforms = config_glgsg.GetBool("gl-show-transforms", false);
-
 // Configure this true to glHint the textures into the cheapest
 // possible mode.
 bool gl_cheap_textures = config_glgsg.GetBool("gl-cheap-textures", false);
 
-// Configure this true to perform a cull traversal over the geometry
-// by default, false otherwise.  The cull traversal provides support
-// for state-sorting, z-sorting, and binning.
-bool gl_cull_traversal = config_glgsg.GetBool("gl-cull-traversal", true);
+// Configure this true to ignore texture modes like modulate that
+// blend texture color with polygon color (a little cheaper for
+// software renderers).
+bool gl_always_decal_textures = config_glgsg.GetBool("gl-always-decal-textures", false);
+
+// Configure this true to disable texture clamp mode (all textures
+// repeat, a little cheaper for software renderers).
+bool gl_ignore_clamp = config_glgsg.GetBool("gl-ignore-clamp", false);
+
+// Configure this true to disable any texture filters at all (forcing
+// point sampling).
+bool gl_ignore_filters = config_glgsg.GetBool("gl-ignore-filters", false);
 
-// Configure this true to disable the use of mipmapping in the
-// renderer.
-bool gl_ignore_mipmaps = config_glgsg.GetBool("gl-ignore-mipmaps", false);
+// Configure this true to disable mipmapping only.
+bool gl_ignore_mipmaps = config_glgsg.GetBool("gl-ignore-mipmaps", false) || gl_ignore_filters;
 
 // Configure this true to enable full trilinear mipmapping on every
 // texture, whether it asks for it or not.

+ 3 - 2
panda/src/glgsg/config_glgsg.h

@@ -24,9 +24,10 @@
 
 NotifyCategoryDecl(glgsg, EXPCL_PANDAGL, EXPTP_PANDAGL);
 
-extern bool gl_show_transforms;
 extern bool gl_cheap_textures;
-extern bool gl_cull_traversal;
+extern bool gl_always_decal_textures;
+extern bool gl_ignore_clamp;
+extern bool gl_ignore_filters;
 extern bool gl_ignore_mipmaps;
 extern bool gl_force_mipmaps;
 extern bool gl_show_mipmaps;

+ 11 - 1
panda/src/glgsg/glGraphicsStateGuardian.cxx

@@ -3142,6 +3142,9 @@ draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
 ////////////////////////////////////////////////////////////////////
 GLenum GLGraphicsStateGuardian::
 get_texture_wrap_mode(Texture::WrapMode wm) {
+  if (gl_ignore_clamp) {
+    return GL_REPEAT;
+  }
   switch (wm) {
   case Texture::WM_clamp:
     return GL_CLAMP;
@@ -3169,7 +3172,10 @@ get_texture_wrap_mode(Texture::WrapMode wm) {
 ////////////////////////////////////////////////////////////////////
 GLenum GLGraphicsStateGuardian::
 get_texture_filter_type(Texture::FilterType ft) {
-  if (gl_ignore_mipmaps) {
+  if (gl_ignore_filters) {
+    return GL_NEAREST;
+
+  } else if (gl_ignore_mipmaps) {
     switch (ft) {
     case Texture::FT_nearest_mipmap_nearest:
     case Texture::FT_nearest:
@@ -3182,6 +3188,7 @@ get_texture_filter_type(Texture::FilterType ft) {
     case Texture::FT_invalid:
       break;
     }
+
   } else {
     switch (ft) {
     case Texture::FT_nearest:
@@ -3346,6 +3353,9 @@ get_internal_image_format(PixelBuffer::Format format) {
 ////////////////////////////////////////////////////////////////////
 GLint GLGraphicsStateGuardian::
 get_texture_apply_mode_type(TextureApplyAttrib::Mode am) const {
+  if (gl_always_decal_textures) {
+    return GL_DECAL;
+  }
   switch (am) {
   case TextureApplyAttrib::M_modulate: return GL_MODULATE;
   case TextureApplyAttrib::M_decal: return GL_DECAL;