Sign in to follow this  

can the alpha in a tex be chaned in game?

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

This topic is 4356 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.

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