Archived

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

WoolyUK

Non square textures?

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
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
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
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
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
Well, I ain''t any expert in opengl, but to get a Image with smooth lines, you could try to aply a blur effect to this. There are many editors that do it. For Example InfarView(i personally like this), that is free and light and don''t need to register in the windows, doesn''t affectin the windows performance.

Share this post


Link to post
Share on other sites
The ARB_texture_non_power_of_two specification is available here.
About how widely it is supported, the only thing I know is that DX9-compatible cards may support that extension, that is Radeon9500+ and GeForceFX+

Share this post


Link to post
Share on other sites
Duncan: it works but has several serious issues :
1- you can''t repeat the texture.
2- mipmapping will mess up when filtering borders.
3- that wastes a big ammount of memory.

Share this post


Link to post
Share on other sites