can the alpha in a tex be chaned in game?

Started by
3 comments, last by anist 18 years, 3 months ago
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
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
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.
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)
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.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.

This topic is closed to new replies.

Advertisement