Jump to content
  • Advertisement
Sign in to follow this  
Noxir

Possible?

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible making a 23x84 picture that could be loaded? I've seen lots of games that doesn't has 64x64 32x32 16x16 only.

Share this post


Link to post
Share on other sites
Advertisement
Hello ,
there is two ways :
First : you can you this extention XX_TEXTURE_RECTANGLE for more info google for it
Second: you can load it the make anoter array its size power-of-2 that can handle the texture and fill the blank area with any color
bye

Share this post


Link to post
Share on other sites
From file you can load every size format.

For texture you have different solutions as ff8 told you


  1. Resize the image to be power of 2 (my favourite)

  2. Using an extension to handle non power of 2 textures

  3. Copy the image in a power of two texture and then use the texture coordinates to map the part you need



The first solution is the simplest.
The third one is also interesting because you can store multiple textures in a single one independently by their 'power-of-two-size'.
The second is dangerous because you may have to disable texturing on system that does not support that extension (or supply alternative solution 1) or 2) )

Share this post


Link to post
Share on other sites
It's already been answered but I want to make one note...
Quote:
Original post by Hydrael
It is possible if you use mipmapping...
No it isn't. Mipmapping doesn't automatically make it possible to use non-power-of-two textures. Many people seem to think that because they use gluBuild2DMipmaps, which resizes the texture to be a power of two.
Quote:
From that Nehe Tutorial Hydrael linked to
I had said in tutorial six there was a way around the 64,128,256,etc limit that OpenGL puts on texture width and height. gluBuild2DMipmaps is it. From what I've found, you can use any bitmap image you want (any width and height) when building mipmapped textures. OpenGL will automatically size it to the proper width and height.
That's somewhat misleading. It's not OpenGL that resizes it, it is GLU.

Share this post


Link to post
Share on other sites
Oh, I'm sorry then.
I've never tried it out - I've just read the line you quoted and thought that's correct.

My fault

Share this post


Link to post
Share on other sites
Just thought Id add a bit to the topic,

as Kalidor was saying gluBuild2dMipmaps, does resize it useing Bilinear filtering, meaning if you are useing masking or something its likely to bleed colors and such, bad if your useing 255,0,255. you can get purple outlines on sprites and such

also the way I do it, I wrote my own bitmap loader, and wrote a rotine that resizes the img to power of two, uploads the texture to ogl, and returns the correct texture coords to use so I only use the part of the texture I want.
this is prolly only a good idea if you not useing the texture to wrap, such as if your making a 2d game, and use sprites. but in any case all that extra memory does go to waste.

sure hope, GL_ARB_texture_non_power_of_two is hardware supported soon, =D.

Share this post


Link to post
Share on other sites
Quote:
Original post by Xero-X2
sure hope, GL_ARB_texture_non_power_of_two is hardware supported soon, =D.


It kind of is... sorta.
iirc the GF6 series supports it and the X800 series supports it as long as you dont try to repeat the texture or use filtering other than nearest.

It usefull for some stuff anyways, like post processing effect outputs.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!