Click here to Skip to main content
Click here to Skip to main content
Go to top

Really cool visual FX

, 20 Aug 2001
Rate this:
Please Sign up or sign in to vote.
A set of classes for doing stunning visual effects, including water, plasma and fire.

Sample Image

The Code Project is on FIRE!

This project has a set of 3 classes that will let you add some pretty cool looking effects (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) of the 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 the source from and converted it into a more object oriented class design. I was originally going to 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 something to 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 idea of 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. Same goes with the plasma and the fire. Try playing around with some of the data members - you can do a LOT more than what my sample application allows.

The animation is achieved with a simple windows timer. The only notable thing about it is the 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 it in something interesting, extend it, want to complain about my lack of documentation (again), or just want to say "hey!".

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

dswigger

United States United States
No Biography provided

Comments and Discussions

 
QuestionCool,Vote of 10~ Pinmemberlanmanck5-Sep-13 19:26 
QuestionHi,How to support 16bit depth use SpecialFX? Pinmembergmmylose200930-Nov-09 0:49 
GeneralDLL Please PinmemberMustafa Magdy13-Oct-09 3:37 
GeneralWrote an MFC CStatic wrappper for these cool effects :) PinmemberHou Tianze13-Jul-09 20:45 
Questiondoes anyone have a version without memory leaks? Pinmembersfgasdfas@asdfasdf.it5-Oct-08 22:18 
Questionanyone has a version without the problem of the buffer overrun? Pinmemberasdf34asdf4-Jun-08 22:34 
GeneralC# or VB PinmemberJohnny J.22-Jan-08 4:28 
GeneralRe: C# or VB Pinmemberdswigger22-Jan-08 8:30 
GeneralThank you for your share! PinmemberMember 404584111-Dec-07 20:17 
GeneralAnother memory leak Pinmembermbw3303-Sep-07 17:14 
Generalfatal error Pinmemberalaa naeem22-Aug-07 21:10 
first of all i want to thank you for this Beautiful work. nut when i imported the files to my project i faced this error:
 
fatal error C1010: unexpected end of file while looking for precompiled header directive CPlasmaRoutine.cpp
 
for the four classes.
 

what causes the error here?
GeneralRe: fatal error Pinmemberasdf34asdf4-Jun-08 21:42 
QuestionWhy so complicated??? Pinmemberchris17522-Aug-06 9:37 
AnswerRe: Why so complicated??? Pinmemberwaldermort14-Sep-06 5:46 
GeneralRe: Why so complicated??? Pinmemberdswigger22-Jan-08 8:46 
GeneralWater effect Pinmembernzembs3-Dec-05 13:21 
GeneralDLL PinmemberRoland8315-Oct-05 7:10 
GeneralTwo bitmaps Pinmemberst0per3-Jul-04 15:30 
GeneralRe: Two bitmaps Pinmemberhongzh12614-Sep-05 15:35 
GeneralWater Error PinmemberSilentDragonz20-Apr-04 16:11 
GeneralRe: Water Error Pinmemberdswigger21-Apr-04 7:18 
GeneralRe: Water Error PinmemberC.Young @ XiCabin9-Dec-05 21:05 
GeneralRe: Water Error Pinmemberebia.tty024-May-06 4:09 
GeneralAbout the water effect Pinmembercaucy20-Apr-04 14:38 
GeneralRe: About the water effect Pinmemberdswigger21-Apr-04 7:21 
GeneralRe: About the water effect Pinmembercaucy21-Apr-04 14:55 
GeneralI don't know how to contact you. PinmemberFai2-Sep-03 18:27 
GeneralRe: I don't know how to contact you. Pinmemberdswigger24-Oct-03 10:29 
GeneralRe: I don't know how to contact you. Pinmemberdswigger24-Oct-03 10:30 
GeneralMemory Leak Pinmemberphilip_love23-Apr-03 2:43 
GeneralRe: Memory Leak PinsussThe Shadow Knows30-Apr-03 17:15 
GeneralRe: Memory Leak PinsussStill Dont Know30-Apr-03 17:29 
GeneralRe: Memory Leak Pinmemberdswigger1-May-03 2:46 
GeneralRe: Memory Leak Pinmemberdswigger1-May-03 2:48 
GeneralRe: Memory Leak Pinmemberawimsatt8-May-03 7:39 
GeneralRe: Memory Leak Pinmemberawimsatt8-May-03 8:10 
GeneralRe: Memory Leak PinmembercK120-Feb-04 10:43 
GeneralRe: Memory Leak Pinmemberoliver_lion22-Oct-05 7:06 
GeneralAnother bug fix Pinmemberoliver_lion22-Oct-05 7:32 
GeneralRe: Memory Leak Pinmember__jda__14-Nov-06 4:48 
GeneralIs there a chance to render the fire effect to a black instead of a red background Pinmembercyberian0121-Apr-03 7:51 
GeneralComplie error Pinmembercjv21426-Mar-03 21:23 
GeneralRe: Complie error PinsussSo1o2-Apr-03 20:26 
QuestionIs it modifiable the efficiency of the fire effect? Pinmemberseyoung pyo24-Mar-03 21:26 
GeneralOptimization for water PinsussJohn R. Shaw7-Mar-03 9:51 
GeneralEffect on Title Bar PinmemberParas31-Jan-03 18:01 
GeneralRe: Effect on Title Bar Pinmembertetsuoii24-Feb-03 12:14 
GeneralC# or VB.NET version PinmemberHasse27-Nov-02 9:34 
GeneralRe: C# or VB.NET version Pinmemberdswigger29-Nov-02 15:50 
GeneralRe: C# or VB.NET version PinmemberAnthony_Yio5-Jan-03 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 21 Aug 2001
Article Copyright 2001 by dswigger
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid