Archived

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

TinkleBear

Copying RGBA values texture->texture

Recommended Posts

Splitting all my tiles up into seperate TGA's in my datafile,then only loading the ones used in the map, and when loading i wish to load them all to one texture... i use alpha testing to transparencys though so i need the alpha......

Im just ripping my TGA loader and not really sure how it works

[edited by - TinkleBear on November 19, 2003 1:16:37 AM]

Share this post


Link to post
Share on other sites
Thanks Mozy,i got another question tho

glTexSubImage2D redefines a contiguous subregion of an existing two-dimensional texture image. The texels referenced by pixels replace the portion of the existing texture array with x indices xoffset and xoffset + width - 1, inclusive, and y indices yoffset and yoffset + height - 1, inclusive.

Okay well whats with the - 1?

Share this post


Link to post
Share on other sites
quote:
Original post by TinkleBear
Thanks Mozy,i got another question tho

glTexSubImage2D redefines a contiguous subregion of an existing two-dimensional texture image. The texels referenced by pixels replace the portion of the existing texture array with x indices xoffset and xoffset + width - 1, inclusive, and y indices yoffset and yoffset + height - 1, inclusive.

Okay well whats with the - 1?


Think about it.

If the region runs from 1 to 1 in x then the width is 1. Ie:
w=xR - xL + 1
So:
xR = w + xL - 1

Share this post


Link to post
Share on other sites