OpenGL texturing filtering

Aliasing problems resolved
Hi!

I'm a long time Plex user, first time Plex hacker! :)

Plex is outstanding in a lot of ways, but I've been frustrated with the distinct aliasing problems when displaying slideshow pictures larger than the display resolution. The problem is caused by the type of OpenGL texture filtering used in Plex today.

Recently I did a minor change to TextureManager.cpp which addresses the issue by applying mipmapping. The improvement in rendering quality is very noticeable. Here's the diff:


diff --git a/guilib/TextureManager.cpp b/guilib/TextureManager.cpp<br />
index b6c991a..158c60c 100644<br />
--- a/guilib/TextureManager.cpp<br />
+++ b/guilib/TextureManager.cpp<br />
@@ -1031,8 +1031,9 @@ void CGLTexture::LoadToGPU()<br />
   glBindTexture(GL_TEXTURE_2D, id);<br />
  <br />
   // Set the texture's stretching properties<br />
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);<br />
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);<br />
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);<br />
+  glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); <br />
   //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);<br />
   //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);<br />
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);<br />




Feel free to include this in your development branch if you like.

BTW: Maybe the type of texture filtering could be made configurable? I haven't investigated the performance implications (expect for the fact that mipmapping incurs a 33% memory overhead), but enabling mipmapping and performing extra interpolation on older systems could potentially cause performance problems. Runs well on my Mini and Macbook Pro (both have NVIDIA 9400M chipset), though.

I love your app. Keep up the GREAT work guys. B)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.