Jump to content
  • Advertisement
Sign in to follow this  
yannouchka

Copy part of a texture into another using texture coordonate

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

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!