Jump to content
  • Advertisement

Archived

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

webjeff

Mip mapping

This topic is 5236 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

I have a texture thats 800x600. I am going to create a texture 400x300, 200x150, 100x75, 50x34.5, 25x16.75 Is that correct, I know examples use 256x256,128x128, etc. Not every texture is that nice. haha. So can I create those textures and add the surfaces onto the main one and do mip mapping? Thanks Jeff.

Share this post


Link to post
Share on other sites
Advertisement
Well, first off, thats a mighty big texture!! ;O)

secondly if you''re using OpenGL im fairly sure textures have to be a power of 2 eg: 512x512, 512x256, 128x64 etc

Im not sure about D3D but I''d bet it was the same.

Also you''re almost certainly going to get a boost by using power of 2 texture than not..thats if the latter are acceptable at all.

Hope that helps.

GCoder

Share this post


Link to post
Share on other sites
Appologies for not answering your question directly!

im quite distracted today

There are mipmapping examples on nehe''s site if you''re using Opengl otherwise I think theres probably D3D examples here on gamedev in the articles section?...worth a look.

otherwise....good old Google! :o)

GCoder

Share this post


Link to post
Share on other sites
If you are using OpenGL or Direct3D, then you can simply supply one version of your texture (the largest version) and the API will create all the necessary mipmaps for you. There''s no need to create all the different sized versions of your texture.

Share this post


Link to post
Share on other sites
Yea, I already searched but all the examples say 256x256, 128x128, etc. Non show a 800x600 so I dont know if I just scale it down by 50% will mip mapping still work?? or do I need to convert my texture to 1024,x1024 for it to work, that would suck.

Thanks
Jeff.

Share this post


Link to post
Share on other sites
why not just have filler on the edges? take your 1024x1024 texture, put your actual 800x600 of data in the top left corner, and set your mapping coords so that the poly on displays the 800x600 area?

also, on a little side note, you''re going to have a really hard time getting 50x34.5 and 25x16.75

Share this post


Link to post
Share on other sites
crap, I forgot the other thing I was going to say! I''m pretty sure that OpenGL will allow you to use non-power of 2 textures (though, I''m sure it''s slower). Nehe mentions it somewhere on his site. I know that in my application I''ve got a poly that''s mapped with a non-po2 image, but I don''t really remember what specifically I did to put it in there. Just have to make sure your poly is the same ratio as the image, or you''ll have stretching

Share this post


Link to post
Share on other sites
If I add filler to the 800x600 image, black, will that mess up the UV coords, and I will need to adjust that or will it work, because 800x600 is still the same, its just extended??

Let me know please, thanks for your help.
Jeff

Share this post


Link to post
Share on other sites
it shouldn''t mess up the coords, ''cause they''re expressed in a range from 0.0-1.0 (unless, of course, you''re doing tiling). I''d try the built in mipmapping functionality first, though. if it works, then great, if not then look for other options

Share this post


Link to post
Share on other sites
Non-power of two textures are supported as an extension in OpenGL.

You need to check the device caps if you''re using D3D (in the TextureCaps part of the caps structure, the flags D3DPTEXTURECAPS_NONPOW2CONDITIONAL, D3DPTEXTURECAPS_POW2, D3DPTEXTURECAPS_CUBEMAP_POW2 and D3DPTEXTURECAPS_VOLUMEMAP_POW2 are the ones to check)

Putting the texture into a bigger (next power of two bigger) texture is a reasonable idea, although (IIRC) you can get problems with filtering pulling texels from outside your original image (especially when using the lower mip levels).

HTH

Share this post


Link to post
Share on other sites

  • 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!