Sign in to follow this  
MaartenDeNef

costum texture size

Recommended Posts

turch    590
[quote name='Sneezy' timestamp='1313644842' post='4850616']
Ty for the reply.
So i have this panoramic sky texture that is 4096 x 1024.
If i want to texture it my uv coordinates are between 0 - 0.5 is that what u mean?
[/quote]
[s]It would be 0-1 in the x/u direction and 0-0.25 in the y/v direction.[/s] Edit: sorry, drunk when I posted that :D
It would be 0-1 in the x/u direction and 0-1 in the y/v direction.

However, some graphics cards might not allow non-square textures, or might allow them but store them as a square texture anyway (so your texture would be a 4096 x 4096 with only the top 1024 pixels actually used) so a safer alternative would be to make it 2048 x 2048 with the left half of the original texture in the top 1024 and the right half in the bottom 1024.

Share this post


Link to post
Share on other sites
InvalidPointer    1842
[quote name='Sneezy' timestamp='1313644842' post='4850616']
Ty for the reply.
So i have this panoramic sky texture that is 4096 x 1024.
If i want to texture it my uv coordinates are between 0 - 0.5 is that what u mean?
[/quote]

UV coordinates are affine, meaning they're unitless and as such are independent from texture resolution. For most purposes, like, say, texturing a mesh, this means you can freely change the global level of detail for the texture and things work out. Loosely, it'd be like the low-resolution texture gets 'stretched out' to cover the high-resolution one (and as an aside, this behavior is a requirement for MIPmapping to work properly)
If you're trying to sample from *specific pixels* in the texture, that changes things-- can you clarify what it is you're trying to do with your texture here?

Share this post


Link to post
Share on other sites
smasherprog    568
Another way to describe uv coordinate is to say that they are percentages. Meaning 1.0 = 100% and 0 = 0%. So, if you have a u coord of .4, it means it samples the tetxture 40% away from the point (0, 0) in the u direction (which is left-to-right, the v direction is up-down). In Direct x (0, 0) is the top left corner of the image, in open gl it is the bottom left corner of the image.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this