Sign in to follow this  

alpha map

This topic is 4843 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 all! I'm still working on the artillery game. Can anyone tell me how to manipulate a texture realtime? This is my problem: all the a's and b's are landscape. It's one big texture. The white space is aplha=0 (for collision detection). As you can see there is a hole in my landscape and all the b's should fall down. I'd like to animate this, so one pixel at the time.
                 aab
               aaaabbb
aaaa       aaaaaaaa
aaaaaaa  aaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
My plan is to go up every column and check if a pixel in the column was set to alpha = 0 and move all the pixels above this pixel one down. If I do this a couple of times with time intervals the b's would seem to move down. Ofcourse i'll stop when there are no more holes. Since the pixels i'm talking about correspond to the texels in my landscape texture I need to be able to do the thing I described above with a texture. My problem is now: HOW?! I can save the aux_rgbimagerec i used to create the texture, modify that and make a new texture (can be a little slow, cause i need the time intervals for the animation anyways)... Has anyone got a better idea? My second question. I've got little bitmaps for the tanks with a blue background. Is there an easy way to make alpha maps to cut away the blue? Thanks, Marty

Share this post


Link to post
Share on other sites
Hi,

I don't think that thats be best idear.
There was a game named clonk (im not shure). I think they use some particle system.
That would be my way too. I think you would have to partition the space and do check for the radius of the impact and update the particles there ( you could simply bind the particles to a grid, and do searchs with that ).

Just an idear. I think with alpha maps you would never get good result at resonable speeds.

Share this post


Link to post
Share on other sites
Hi!

Thanks for the idear. I guess it's allready what i'm trying to do here. It would become a shitload of particles (at 800x600 half the screen is landscape) so that means 240000 particles. I would prefer pixels over particles, because it's essentially the same thing, only a pixel can't do anything. The alghorithm to sort out what the pixels are doing can be faster than an alghorithm that has to work for every particle... Well thanks a lot anyways, i might look at the particle thing aswell, cause a lot of stuff that can be shot might aswell be particles, so why not the ground itself.

Marty

Share this post


Link to post
Share on other sites

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