• Advertisement

Archived

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

Copying RGBA values texture->texture

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

Advertisement
Not directly.. and there is no reason to ever make a pure copy of a texture so no. Why do you want to do that? ( maybe there is another , better way to do this)

Share this post


Link to post
Share on other sites
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
Make a large texture with glTexImage2d, and null as the last value.
then upload each part with glTexSubImage2d..

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
isnt that just to point out that the texures lower left = (0,0) and not (1,1)? i havent thought of that, and it works for me

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

  • Advertisement