Jump to content
  • Advertisement

Archived

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

WoolyUK

Non square textures?

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

hi guys Im making a sports game, and am trying to make the pitch texture. However, the pitch isn''t square, its 5x7 units... How is best to design the pitch as a texture, because you can only have square textures i believe? 128x128 etc? I tried making the pitch as an image 500x700 pixels then resizing it to 512x512 and applying it as the pitch texture in opengl, but it looked to distorted and low quality. Any suggestions please? Thanks for any comments! Adam

Share this post


Link to post
Share on other sites
Advertisement
Couldn''t you split it into several equal segments and make several squares for the pitch? Or two triangles?
Or...make the texture bigger than the pitch, and let it be stretched down into 500x700? That is..if opengl does that.

Share this post


Link to post
Share on other sites
No it doesn''t have to be a square... The dimensions just have to be a power of two. You might wanna try resizing it to 512*1024.

Share this post


Link to post
Share on other sites
Thanks for replies

I tried making it 512*1024 in paint shop pro then applying it to the 5x7 pitch in opengl and it still looks a bit distorted

It''s slightly better tho I think

Surely theres a way to get it perfect quality?

Thanks again,
Adam

Share this post


Link to post
Share on other sites
You could make your pitch say, 500x600, then make a 512x512 texture, it''d look fairly close. As far as I understand you wont get a perfect texture in a 500x700 area, unless you split it into smaller textures.

Share this post


Link to post
Share on other sites
Have you tried using gluBuild2DMipmaps yet? That will auto-scale your image to powers of two and might make it look better, depending on the situation. Also, you could try playing around with the settings for MAG_FILTER and MIN_FILTER.

Share this post


Link to post
Share on other sites
Try some of the loading code at www.gametutorials.com you can use images of all sizes.

Share this post


Link to post
Share on other sites
as far as i know all geforces support NV_texture_rectangle, and all radeons support EXT_texture_rectangle (wich in the end are the same extensions and soon get mixed/fixed together into the ARB :D), so you could use them, depending on your minimum hw..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
NV_texture_rectangle or EXT_texture_rectangle may work here!

BTW, does anyone know whats up with these ARB_texture_non_power_of_two extension???

Share this post


Link to post
Share on other sites
yep, its (all guessed only:D) about the same as texture_rectangle.

but:
texcoords are between 0 and 1 again

it supports 1d,2d,3d textures, and possibly even cubemaps..

would be a too proprietary extension.. arb always tries to find a general solution, and only 2d textures, with changed coordinate-ranges and no mipmapping and no coordrepeating and all that definitely is not general..

how well it will be supported?.. dunno yet.. have to check dx9 specs what is supported there, and how much of it is supported on my card for example..

"take a look around" - limp bizkit
www.google.com

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!