Sign in to follow this  
adam17

NPOT Textures

Recommended Posts

adam17    227
ive been trying to get my texture loader to support non-power of two textures. after doing some research here and on google, i started using gluBuild2DMipmaps to load them. it works fine, but i was wondering if there was a way to get rid of the white bars. i know that it stretches the image to the nearest power of 2, and then adds white space to stretch the image in the other dimension. i know this because when i map it using normalized coordinates to a quad on screen, i get white bars on top and bottom. i want to use coordinates [0..1] in the s&t dimensions, and get rid of the extra space. is there any way i can fix it? hopefully im making sense.

Share this post


Link to post
Share on other sites
Brother Bob    10344
To be honest, it doesn't make much sense. What "white bars" are you talking about? If it stretch the image to neares power of two, where does the "white bars" go if the image covers power of two dimensions already? Can't say I've ever seen anything similar whay you describe regarding gluBuild2DMipmaps.

Unless you're targeting old platforms, keep in mind that the power of two restriction on every kind texture object was removed in OpenGL 2.0. Just upload and use the texture like it was of power of two dimensions.

Share this post


Link to post
Share on other sites
adam17    227
WOW i had a huge blonde moment! i was using an image that i was using in initial testing, which was 512x512. i used photoshop to add a white block on top and bottom to make it 512x512 from 320x240. i went back and created a new image and made sure it was of weird proportions. it worked. im an id10t lol

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this