Sign in to follow this  
yannouchka

Copy part of a texture into another using texture coordonate

Recommended Posts

yannouchka    122
Hi everybody, I am actually looking for functions allowing to copy a part from texture A into texture B using some texture coordonates. This coold allow to make rotation, scaling and transform from one area of a texture. Any idea? I kown I should apply the area from texture A using text coordonate into an object and then render the scene into texture B, but is there another way to do it? Thanks Yannouchka

Share this post


Link to post
Share on other sites
soconne    105
You need to use the function

glTexSubImage2D

It will let you upload an array of color values into a bound texture. This is the easiest way.

Share this post


Link to post
Share on other sites
python_regious    929
If you want to be able to rotate, scale and translate one part of a texture onto another texture, then you have a few options. You could use the texture matrices and use multitexturing. You could have different geometry for the two textures, and render one ontop of the other. Or, you could do it in a multipass fashion. Or, if you want to use the texture later on, for something else, then you'd have to render to a texture, see the GL_EXT_frame_buffer_object extension to achieve this.

It's hard to know exactly what you want though.

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