Jump to content
  • Advertisement
Sign in to follow this  
SelethD

can the alpha in a tex be chaned in game?

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

I am using TGA images for textures, with an alpha channel. I was wondering if there is a way to modify the alpha value of the texture once its loaded without having to re-load the image, or load the same image with a different alpha. thanks

Share this post


Link to post
Share on other sites
Advertisement
1) keep the image in ram, modify it and upload it agian (glteximage or whatever)
2) use a pixelshader to change it
3) maybe simple blending operations may be enogh to solve your problem

Share this post


Link to post
Share on other sites
the first solution (keep in ram and upload again)

how system intensive would that be, not that I would be changing the alpha every frame, but if I 'did' require that, how much performance might I loose?

I mean the actual 'uploading' part of it.

Share this post


Link to post
Share on other sites
test it + see wouldnt take to long to write a demo
im guessing with a reasonable card u can update a 512x512 RGBA texture at least 100fps (so not to bad, but first test)

Share this post


Link to post
Share on other sites
you could also try this if you want to affect the entire textures alpha: set the texture combining to modulate and use the color 1.0,1.0,1.0,1.0 on the polys it's placed on. now change the polygons color's alpha instead of the textures when you want it to be more transparent.

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!