Texture mapping with big image
Dear All,
I am using VB6. I have tried lession 6 of Texture Mapping. Could anyone let me know how to work with image of its size bigger than 256 * 256. For example: I have picture Width=2541 and Height = 1346. Or some image even much smaller, Height:210 and Width=78.
Appreciate all your helps.
First check the max size of textures possible by your videocard. If your texture is bigger than that, you have to split it in multiple parts.
Then, if your card supports non-power-of-2 textures then just load texture, if not, you have to resize them to next POT size.
Then, if your card supports non-power-of-2 textures then just load texture, if not, you have to resize them to next POT size.
You should never let your fears become the boundaries of your dreams.
So you mean I should split the picture into small small parts of 256 x 256. And create mulitiple texture to hold those images and put them in place together?
Anywhere of sample I can have a look?
Cheers
Anywhere of sample I can have a look?
Cheers
I think the problem isn't the texture size, but the dimensions.
Texture's usually need to be resized to power of 2 size.
(this means 256x256 or 512x512 or 1024x1024 or .... )
Try resizing your images to one on those dimensions, and it will probarbly work.
Texture's usually need to be resized to power of 2 size.
(this means 256x256 or 512x512 or 1024x1024 or .... )
Try resizing your images to one on those dimensions, and it will probarbly work.
Note that there are a couple of things to look out for when using non-power-of-two (NPOT) textures.
If your texture is intended to be displayed exactly as it is on screen (i.e. one pixel in the image = one pixel on screen) and you don't have access to an NPOT texture extension (or don't want to use it) then you want to pad your image to POT size, use nearest filtering and adjust your texture coordinates to only display the correct subregion of the padded texture. This method means that at different resolutions the texture will take up differing amounts of screen space.
If you want your texture to be displayed to fill a certain proportion of the screen, regardless of resolution, then you want to stretch your texture to POT size and use linear filtering. Note that the gluBuild2DMipmaps function can load an NPOT texture and automatically scale it to POT size for you.
Enigma
If your texture is intended to be displayed exactly as it is on screen (i.e. one pixel in the image = one pixel on screen) and you don't have access to an NPOT texture extension (or don't want to use it) then you want to pad your image to POT size, use nearest filtering and adjust your texture coordinates to only display the correct subregion of the padded texture. This method means that at different resolutions the texture will take up differing amounts of screen space.
If you want your texture to be displayed to fill a certain proportion of the screen, regardless of resolution, then you want to stretch your texture to POT size and use linear filtering. Note that the gluBuild2DMipmaps function can load an NPOT texture and automatically scale it to POT size for you.
Enigma
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement