티스토리 뷰

흔석/프로그램 개발

Really cool visual FX

JOHNPARK82 2006. 5. 31. 01:45

Sample Image

The Code Project is on FIRE!

This project has a set of 3 classes that will let you add some pretty cool lookingeffects (real-time) to images/dibs.

Again (as with my wave editor control) I pulled these out of my code archive, dusted them off,and made a little project that some people might find useful. ie: I did not document much at all.

After running the demo click on the 'Animate' button. Then move your mouse across the image, click,then play with the other settings. The sliders are used to change the alpha (transparency) ofthe plasma and fire effects. You have to release the slider for the alpha change to take effect.

You generally see these effects used in real-time demos, which is where I culled most of thesource from and converted it into a more object oriented class design. I was originally goingto use them as the basis for a series of VIS type plugins to be used in an audio application.As commonly happens that project sort of went to the wayside.

I included the CDibSectionLite class created by Chris Maunder in the project just so I had somethingto render onto/with. The effects expect all data to be 32bit depth image data.

CWaterRoutine - Renders the real popular water effect
CFireRoutine - Renders simulated fire
CPlasmaRoutine - Renders real-time plasmas

By looking at the code for these effects you should notice they are all based around the ideaof using a separate filter to achieve their results. If you have never looked at the water code(for example) you will be amazed at how such simple routines can create such a wonderful effect. Samegoes with the plasma and the fire. Try playing around with some of the data members - you cando a LOT more than what my sample application allows.

The animation is achieved with a simple windows timer. The only notable thing about it isthe way I chained the effects together, by rendering one on top of another.

You are free to use the code as you wish, just drop me an email if you use itin something interesting, extend it, want to complain about my lack of documentation (again), orjust want to say "hey!".