Jump to content
  • Advertisement
Sign in to follow this  
Kram

Ice Frost effect

This topic is 3212 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, Ive been put into another tight spot and I need to create a WPF effect that looks like ice/frost freezing over an image (which is just a blue rectangle). The approach I want to take (because I need this be be very performance wise) is to use a pixel shader or a writeable bitmap... The real effect, basically is applied to one image, but can be instantiated by multiple clicks on that image in different spots. When a user clicks their mouse, I want a slowly, organic like, growing frost effect to grow out from under their mouse. Then if another click is made, say to the complete other side of that same image, then another growing frost effect is started (so now I would have 2 growing frosts on the run!). Trouble is, I dont know where to begin with something like this... I was thinking along the lines of a writeable bitmap, and somehow apply it as an opacity mask?? What do you all think? Maybe someone has a much better idea?

Share this post


Link to post
Share on other sites
Advertisement
well, the issue with that is that if there are two of these effects running on the same image, when their edges meet as they grow I want them to blend together nicely, pre-baked animations I dont think would do the trick.

Thanks

Share this post


Link to post
Share on other sites
Again, I've not used shaders much and only in Direct3D so this might not be applicable to WPF.

Can you write the results of each shader pass to an intermediate surface and modulate previous values with new ones so that they blend properly?

Share this post


Link to post
Share on other sites
Sadly, from what I have read WPF does not support multiple passes of a pixel shader...

But you can apply multiple pixel shaders to a single image...

Im thinking more of using a writeablebitmap which allows me to write pixels directly to a bitmap (hence the name :) )

That way I could do some programatic logic behind the scenes to slowly fill out the image, adjusting the alpha of the increasing blob, then combine multiple blobs when they join... although that sounds hard to me :(

Thanks for the advice so far!

Share this post


Link to post
Share on other sites
Diffusion Limited Aggregation fractals, if saved at various intervals of progression, make for a nice spidery effect suitable for propagating cracks. Such a series of saved images would be suitable for one freezing effect. Generating more will create enough variation for use on several freezing effects in game. Be sure you seed the fractals from the center of the image, to make it easier to offset the cracking pattern onto where the user clicked.

With this series of procedurally generated bitmaps, you have the basis for your effect: simply apply the bitmaps in layers on top of sprite in question (offset so that the center of the fractal is where the user clicked), with some color tweaks or shaders to make it look more interesting. Use the sprite's alpha as a mask to make sure the fractal freeze layers are drawn only on top of the sprite in question.

You could try generating the DLA fractals in real time for every fractal freeze effect, but that's inefficient. You'd be better off making and storing a new batch of DLA fractal freeze bitmaps as a background process.

If you want to try optimizing DLA fractals so they run in real time, then you might be able to achieve the point blending effect you were looking for.

Share this post


Link to post
Share on other sites
Hi JDS0,

Thanks so much for that, what a great help. But correct me if Im wrong, that would give more of a cracked look, rather than a frozen, frosty look, correct?

What I have managed to do so far is to use a pixel shader that I found in the WPFFX codeplex site that uses a randomized circular transition, that I had to modify slightly, but its on the right track... I cant really show a screen shot, but its hosted here:

http://wpffx.codeplex.com/

Its official name is: RandomCircleRevealTransitionEffect

But I do need cracking too (that was going to come next!) so thanks for the resources...

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!