Rune Central

The Official Rune Quake Message Board
It is currently Sat Aug 15, 2020 11:11 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Myth busting time? High res textures?
PostPosted: Tue Nov 15, 2005 11:29 pm 
Offline

Joined: Sun Mar 09, 2003 10:47 pm
Posts: 1612
Location: Ohio
The code below and the code it references look to me like high resolution textures are being resampled/resized down to the same size as the WAD texture in the map.

1. Is this true?

2. If it is true, then there isn't such a thing as a high res texture, correct?

They wouldn't be high resolution textures, just 24 bit ones, right?

Code:
int GL_LoadTextureImage (char *filename, char *identifier, int matchwidth, int matchheight, int mode)
{
   int      texnum;
   byte      *data;
   gltexture_t   *gltexture;

   if (no24bit)
      return 0;

   if (!identifier)
      identifier = filename;

   gltexture = current_texture = GL_FindTexture (identifier);

   if (!(data = GL_LoadImagePixels(filename, matchwidth, matchheight, mode)))
   {
      texnum = (gltexture && !current_texture) ? gltexture->texnum : 0;
   }
   else
   {
      texnum = GL_LoadTexturePixels (data, identifier, image_width, image_height, mode);
      free (data);
   }

   current_texture = NULL;
   return texnum;
}


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2005 5:31 am 
Offline
User avatar

Joined: Fri Oct 24, 2003 2:09 pm
Posts: 252
Location: Hungary
Quote:
The code below and the code it references look to me like high resolution textures are being resampled/resized down to the same size as the WAD texture in the map.


I dont get it what makes you think this... at least not about the piece of code you copied here. That function tries to load the hi-res texture with the given filename. If it doesnt find one, then it uses the original (lo-res).

Of course it scales up or down the resolution of the image dependig on the resolution you're using, but it doesn't do it unnecessarily.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2005 5:41 am 
Offline

Joined: Sun Mar 09, 2003 10:47 pm
Posts: 1612
Location: Ohio
Code:
GL_LoadImagePixels(filename, matchwidth, matchheight, mode)


This piece of code seems to indicate that the loaded 24 Bit texture gets resized to the same dimensions as the original texture in the map. (I've looked at some of the other functions.)

Am I understanding what is going on here correctly? That the 24 bit textures are getting resized to match the original textures pixel width.

If so then high resolution textures aren't any higher resolution in-game than the originals.

Or I am all wrong here?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2005 6:15 am 
Offline

Joined: Sun Mar 09, 2003 10:47 pm
Posts: 1612
Location: Ohio
Nevermind, I did a couple of experiments and I'm wrong. :D


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2005 10:11 pm 
Offline
quake.intertex.net
User avatar

Joined: Sat Nov 15, 2003 7:39 pm
Posts: 243
Location: Kansas City!
:O

matchwidth, matchheight = current resolution width and height

But something along that note.. or is it.. ansiotropic filtering does help textures look more clearer at a distance...! I use x8, nice speed with better visibilities. Even on alias model textures.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 18, 2005 4:25 pm 
Offline
User avatar

Joined: Fri Oct 24, 2003 2:09 pm
Posts: 252
Location: Hungary
First of all the GL_LoadTextureImage() function is not used at all when loading WAD images. It is used mainly for loading model textures. For WAD images GL_LoadPicImage() is used.
Second, if you check out the image loading functions (LoadTGA, LoadPNG, etc.) you can see that values of matchwidth and matchheight won't get used in case they equal zero. And most of the times, they do equal zero. This is tipically just a way to let the programmer to control the size of some images. Normally (using 0 value) he doesn't care about file sizes, so for example if you set an 1024x1024 image for the player's face, then it WILL be an 1024x1024 image in memory.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group