Archived

This topic is now archived and is closed to further replies.

Basiror

texture sizes not multiple of 2

Recommended Posts

i wonder how they did it in halflife there you can use 144*144 as texture for example in my engine those textures aren t displayed do they scale the image to the next biggest 2^x where they fit in i think there is a scale function somewhere or can i disable this stupid limitation

Share this post


Link to post
Share on other sites
They scale it up to 256x256, or down to 128x128. I believe this is configurable actaually. It was in glquake

Edit: configurable in that you can choose whether they scale up or down

[edited by - demosh on November 2, 2002 10:45:56 PM]

Share this post


Link to post
Share on other sites
No, that''s not the only way. You can, in fact, use textures whose heights and widths aren''t powers of two by enabling an OpenGL extension: NV_texture_rectangle. I don''t know too much about it, but I''m sure you could find out about it at the OpenGL extensions repository here

However, this has an obvious limitation: it only works on selected graphics cards. Another way you could do it is this (if the texture really has to be it''s original size): take the image, put it into a power-of-two texture that''s bigger (for your 144x144 image, put it into a 256x256 texture) and then tweak your texture coords so that only the 144x144 image bit shows on the 144x144 quad its being displayed on...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You''re Already Here | The Best Film Reviews ]

Share this post


Link to post
Share on other sites