Help - Search - Members - Calendar
Full Version: Fire Light flicker
Hash, Inc. Forums > Featured > Feature Films: Tin Woodman of Oz - Scarecrow of Oz > Tin Woodman of Oz > TWO Effects
cfree68f
Well I'm stuck trying to create the light flicker that comes with fire. I know I could just hand animate the intensity of a light and its position, but I'm wondering if theres a more "automatic" or better way to simulate this.

I've tried coming up with equations for odd sin curves to control the position and intensity of a light. I've tried just doing random ranges and having the light flicker, which gets part but not all of the effect. I need little pops and flickers, with smooth rise and fall, left and right, and smooth rise and fall in intensity.. by smooth I mean over a second or two, versus per frame flicker.

Any ideas?
Caroline
I tried this too in This Thread, trying with light gels and particles, but I wasn't clever enough to complete it, and finally went with animated light. Bruce Del Porte's movie in that thread looks great, and I think he's using light gels.

If you get something going with light gels, I'd love to know what you did smile.gif
cfree68f
Thanks Caroline, I'll look into that. it might get me part of the way there.

Fishman
Colin,
Perhaps you could get the same effect using an animated material on the light similar to what Will Sutton does in this tutorial? - http://www.zandoria.com/caustics.htm

Scott
cfree68f
I've tried gobos and stuff, but theres one problem with that and this effect. fire doesn't cast shadows unless theres something between it and the surface to cause a shadow.

The real effect is actually just the overall intensity and source of the light changes over time. So if everything is equal and there is no object between a fire and the surface it lights.. all you should see is a flicker of the light intensity and the appearance that the light source (ie the flames) is shifting in space slightly. The latter effect is really more noticable in the way shadows get cast by the fire. The shadows should dance, and the light should dim and brighten almost like a sin curve but much more random.

I've almost got it with a little expression editing. I'll get it down and if it works I'll post the result.
higginsdj
I'd use 2 lights, use expressions to shift them laterally in relation to the object you are illuminating and use expressions to adjust their brightness and hue. I'd recommend applying a Random function rather than a sine curve since fires flicker rather than rythmicaly change chnage intensity. The ire should have a base brightness so it's just a matter of applying a Random value above that - say a random value between 1 and 5 multiplied by a constant to give your min and max flicker intensity changes.

Cheers
MMZ_TimeLord
I forget which thread had a fire effect in it, but the project came with a light that moved around a bit, and all I did was vary the color and intensity a bit in my shot 2_05_01 and 2_05_02. I haven't yet uploaded the new movies, but the flicker looks like a good start and it's only one animated light.

You are welcome to pull it out of the project and see if it will make a good addition/starting point for you
johnl3d
Click to view attachment


I tried playing with an expression and a light (light attached to a single spline model to get pose to work)I then put into a box and got the above..need to think through the expression... just guessed.

Is this even close?

Dhar
You got it John. I think with minor tweaks this'd be perfect.
higginsdj
Yep - just need to randomise the period of each flicker to slow some down.

Cheers
cfree68f
Its close John. I got it working in another program and I'm working on translating my expression to AM. What I did was I started with a sin curve and added a random function to that that only happens every 5th or 10th frame. Then I added another random function with a smaller amount 1,2 to give it a little slight jitter. So that was three levels of animation on the intensity. Then I added the exact same expression to the y translate and another line to it for the x translate.. smaller amount on the x.

This all looks good and can be tweeked to animate just about any speed. I also added a second light with the same but slightly varied expressions and offset by 1 unit to get a more volumetric effect on the shadows.

I'm working on doing the same thing in AM.. if I get it I'll post the result.
cfree68f
I think I got it.. It was much easier figuring it out in AM than the other app (as usual ;-)

Here is a screen shot of the expressions and the curve they create. The jist is that the Modulo function splits the timing into two parts so I can use an if statement to creat to slightly different sin curves with random jitter on them. You could nest multiple if statements with Mod(GetTime()) tests to split the curves up into more parts as well, but two is fine for this effect.

Click to view attachment

Here's what it looks like rendered

Click to view attachment

and of course the project file if you want to dink around with it...

Click to view attachment


Thanks for all the help guys and girls, I knew coming to the forum was the answer smile.gif
cfree68f
Had to take it one step further.. so I set up a lensflare on the light and added the same expression to the intensity of the flare. I'm loving AM expressions. At first I looked at the syntax and layout and thought, theres not much that can be done here, but boy was I wrong. It only seems that way because of the single line "equation" style of the interface. Adding "if/else" statements that can be nested opens up a world of possibilities, and the "equation" style actually gets pretty intuitive once you get used to it (like and excel spreadsheet style equation).

I'm wondering.. is there another scripting option for AM (I remember a python scripter a while back) that allows you to do "for" and "while" statements and create your own variables?

anyway.. here's the shot of the lens flare with a camera pan for added effect, make sure you put on your Welding goggles ;-)

attachment removed for better version below...
cfree68f
I can't stop myself.. expressions are just to much fun.

I had to add sparks (streaks with the same equation on their emit number)

Click to view attachment
Paul Forwood
Ooo! Nice! Welding! smile.gif
I think that the lens flare creates the illusion of very intense light, like a welding torch, rather than a log fire for instance.
That would cool with some crackles and pops.
Zaryin
Ha, that is great! I wish I understood how any math works so I could screw around with you, Colin smile.gif.
johnl3d
Nice !...my first guess used a if else with a couple of randoms also.

I named the project firelight also...
cfree68f
QUOTE
I think that the lens flare creates the illusion of very intense light, like a welding torch, rather than a log fire for instance.
Yeah I got carried away. I had to see what the weld/flare effect would look like.

My only gripe with the whole thing is that the sparks are to slow, but I couldn't figure out how to make them move faster and keep them from blasting way out off the screen. Any ideas on that?

QUOTE
Nice !...my first guess used a if else with a couple of randoms also.

I named the project firelight also...


Hey Great minds think alike John. Maybe I was just channeling your genius. I thought the solution came a little to easy to me ;-)
johnl3d
Not sure who was channeling genius I was probably asleep but for your sparks you might try playing with the Viscosity setting.... the lower the higher and farther the streaks fly and the higher setting the opposite


Click to view attachment


I varied the viscosity setting from 30 to 15 to 30 on this test (I tried it in v14 as an alpha test)


ypoissant
Hey! Cool use of expressions Colin. And very convincing fire light effect.
cfree68f
Thanks guys,

Yeah I tried viscosity John.. it sort of helps. What I ended up doing was tweeking the world dynamics to double the y force. Then I increased the Magnitude on the Cone force I used and increased the velocity of the particles accordingly. That seemed to work good. Kind of a hoakie way to do it, but I couldn't figure out another way.

Streaks seem to have some elements of their dynamics hidden to the user, vs the way you can tweek things on sprites. ie gravity. He maybe you can tweak velocity over time.. that might do it.. I'll look into that later.

Anyway, I had to try one more thing with expressions just to see if it would work. It kind of works but I think with some more thought it'd work pretty good.

Its a cobra animated with expressions. the majority of the body can be tweeked by editing one or two numbers.

Click to view attachment
johnl3d
Colin you really know how to express yourself..nice snake



For the streaks I left the gravity but nuetralized it with a y force... most things can be done if you tinker

GAngus
"a cobra animated with expressions" !!!

Oh-man... Colin, I have just been working on a snake model too, only just with bones and doinking away with it in a chor but... using expressions !!!???
How does one even begin to do such a thing?
I mean, do we still need bones in the model and if so, how are they refrenced by the expressions ?
What links the model to the expression, is what I guess is what I am asking ?
thanks for any clue or link(s).
jerry a
cfree68f
Hey Jerry,

there's probably many ways to skin this cat, I just chose the expression rout to see if it could be done easily.

What I did was to "bone the snake" lol, as you might normally.. lol sorry, I'm cracking myself up here. Nightdrunk I suppose.

Anyway, rig the snake as you would do if you where going to keyframe it, except don't parent the bones that you want to animate with expressions under the main bone. You'll use constraints to do that. Then in an action or in the choreography, constrain each bone to the bone in front of it in the chain using a "translate to" and an "orient like" constraint. You'll have to offset the "translate to" constraint or use the compensate button when you apply it. Then when you want to animate the snake you'll apply a sin curve animation to the first bone you want to animate. You'll apply something like this... Sin(GetTime()*2)*50 ... to the RotateY transform.

Then just go back over your orient like constraints and apply a lag to them of several frames. In my case I applied a 10 frame lag, which was about 1 quarter of the length of the Sin curve. The tighter the curve the smaller the arc in the snake's motion, and the faster it looks like its moving, but you can tweek that as well with some extras on the expression. I got it as far as I cared to go with it.

You could also vary the lag going back toward the tell to alter the shape of the motion, or put an easy on the curve with some fancy math.

Another way to animate the snake would be with a path constraint and an appropriately shaped path. The problem with the path method would be in the number of bones it might take to constrain a cobra with its head up to the path, and that the path itself becomes part of the rig.. not a big deal, but was more work than I cared to put into this little test.

Hope that helps. Let me know if you have any questions..

GAngus

"you'll apply a sin curve animation to the first bone you want to animate. You'll apply something like this... Sin(GetTime()*2)*50 ... to the RotateY transform."

Ah, that's what I wanted.
Thanks ... that demystifies it a bit and gives me a place to start.
On ... what I am sure, will be an interesting adventure into the math part of how to control bones to animate a model.
I find this truly fascinating somehow but am not really a math-head but then probably just a wannabee, a little.
Will give a shot.... later
tx
yardie
I am making some short video tutorials that I hope to upload to youtube. I need some help with the AM "Expressions". It has been a while since I did C and C++ but I still have an understanding of the logic used. In particular I would like help in making an object bounce in one direction then after a set time or distance for the object to bounce in another direction. I am familiar with the GeTIme(), Sin(), Cos(), Abs(), and Exp() Functions to make a bounce with decay. I have tried using the IF function to change direction with no luck.

I tired to make an expression for a Yo Yo sting so the string object can be seen to roll up and down but I gave up as my maths is a bit rusty. The idea of the video tutorials is that I never have to worry about remembering and expression every time I need to make on. My bounce tutorial should be on the tube by the end of this week. It will probably be posted as a video response to one of Johns tutorial.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.