Copying RGBA values texture->texture

Started by
5 comments, last by TinkleBear 20 years, 5 months ago
Anyone know of an effective way of copying RGBA values from one texture to another?
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)
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]
Make a large texture with glTexImage2d, and null as the last value.
then upload each part with glTexSubImage2d..
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?
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
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

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

This topic is closed to new replies.

Advertisement