AuthorTopic: Tips on animating any moving light source e.g. fire?  (Read 1056 times)

Offline Hoogo

  • 0001
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile
Hello, I was quickly working on an animation for pixel dailies and I found myself wondering
how to proceed to animate light from a moving light source. Are there any tutorials, tips you might have?

Thanks in advance!

Regards,

Hoogo.

P.S. Here's the animation I made, the highlights look dull due to the lack of movement.
« Last Edit: May 08, 2018, 01:28:17 pm by Hoogo »

Online eishiya

  • 0100
  • ***
  • Posts: 1131
  • Karma: +2/-0
    • DerpTree
    • http://pixeljoint.com/p/28889.htm
    • eishiya
    • View Profile
    • Webcomic: Black Dram

Re: Tips on animating any moving light source e.g. fire?

Reply #1 on: May 08, 2018, 01:56:26 pm
As the fire or other light source moves, the bulk of its light comes out of a slightly different place. If you shade each frame based on the light's position in that frame, you'll get the effect of a moving light source when the frames are animated. There's no special trick to it, it's just basic lighting stuff.
You can simplify this process by considering how much and what direction the light has moved in, and possibly just moving some of the lit areas over based on that (remember though, cast shadows won't all shift the same amount, since the angle of the light impacts the location of the shadow a lot).
For lights that barely move, like flames, I find it works better to just slightly change the light areas, e.g. change their edges slightly (they should be slightly irregular for flame anyway). That creates the illusion of the light source moving slightly. However, if there are any objects near the flames that create cast shadows, those shadows could move significantly even from very small motion, because like I said, the angle of the light has a strong effect on cast shadow position, and when the object is close to the light, minor movement can change the angle significantly.

What is the main light source in this scene, and will it also be moving? The steps, floor, and columns are illuminated by something other than the flames, and the flames do not appear to light up anything at all.

Offline Hoogo

  • 0001
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile

Re: Tips on animating any moving light source e.g. fire?

Reply #2 on: May 08, 2018, 02:28:21 pm
Quote
What is the main light source in this scene, and will it also be moving? The steps, floor, and columns are illuminated by something other than the flames, and the flames do not appear to light up anything at all.

Actually I meant to make it so that the two torches were the only light sources. I am aware that it doesn't seem like it
that's why I posted on here to get advice. So that's my thinking:
  • The two torches are off the column by a bit, so they still light what's behind the columns, only on a big enough angle though
  • The middle would be the part that's the most lit because light is shone by the two torches
  • There are highlights on both sides of the bricks for because there are two light sources

Please feel free to tell me what's wrong or not. Also any tips of making this particular piece look more realistic would be much appreciated!

Thank you a lot for your advice on moving lights!

Online eishiya

  • 0100
  • ***
  • Posts: 1131
  • Karma: +2/-0
    • DerpTree
    • http://pixeljoint.com/p/28889.htm
    • eishiya
    • View Profile
    • Webcomic: Black Dram

Re: Tips on animating any moving light source e.g. fire?

Reply #3 on: May 08, 2018, 04:12:37 pm
Torches don't actually illuminate very far, so your brightest areas will be the columns right around the flames, and fairly little light would reach the steps. The brightest steps would probably be the lower 1-3 steps, as the upper steps are also the furthest away (don't forget that your scene has three dimensions, even when you're working in 2D).
The columns will also block a lot of the light from reaching the steps. If you're not sure where the cast shadows would fall, try drawing a schematic of the scene from above.

If the torches are meant to illuminate the stairs, then putting them on the sides of the columns, facing towards the stairs, would be better, as the light would be closer to the stairs and would not be blocked by the columns.

I recommend working out the shading for just one frame (or two, the first with the wall, and the last with all the steps revealed), to make sure you understand what's going on with the light before you commit the time to do all the frames.

Offline Hoogo

  • 0001
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile

Re: Tips on animating any moving light source e.g. fire?

Reply #4 on: May 08, 2018, 04:39:06 pm
Quote
I recommend working out the shading for just one frame (or two, the first with the wall, and the last with all the steps revealed), to make sure you understand what's going on with the light before you commit the time to do all the frames.

Yes thank you that indeed seems like the wiser thing to do.


Quote
try drawing a schematic of the scene from above.

Do you mean something like this?
Where the yellow lines show where the torches' light go and green circles show the area of effect of the torches?


EDIT: I tried to focus on what you were saying about the lighting hitting mistly the first steps, and I added perspective as well. Does that look better to you?
« Last Edit: May 08, 2018, 06:18:48 pm by Hoogo »

Online eishiya

  • 0100
  • ***
  • Posts: 1131
  • Karma: +2/-0
    • DerpTree
    • http://pixeljoint.com/p/28889.htm
    • eishiya
    • View Profile
    • Webcomic: Black Dram

Re: Tips on animating any moving light source e.g. fire?

Reply #5 on: May 08, 2018, 07:35:49 pm
That does look better, but don't forget to take the gradual fall-off of the torches into account. The further steps are probably not going to be as brightly lit as the nearer ones.

Also, don't forget that the columns are also objects in the scene, they should be lit up by the torches. The columns immediately around the torches would get more light than anything else in the scene.

Offline Hoogo

  • 0001
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile

Re: Tips on animating any moving light source e.g. fire?

Reply #6 on: May 09, 2018, 06:57:11 am
That does look better, but don't forget to take the gradual fall-off of the torches into account. The further steps are probably not going to be as brightly lit as the nearer ones.

Also, don't forget that the columns are also objects in the scene, they should be lit up by the torches. The columns immediately around the torches would get more light than anything else in the scene.

How about that, is that any better?

Online eishiya

  • 0100
  • ***
  • Posts: 1131
  • Karma: +2/-0
    • DerpTree
    • http://pixeljoint.com/p/28889.htm
    • eishiya
    • View Profile
    • Webcomic: Black Dram

Re: Tips on animating any moving light source e.g. fire?

Reply #7 on: May 09, 2018, 02:35:01 pm
You're failing to take the fall-off into account. It's true that the light is brighter in areas reached by both torches, but the there's less of each torch's light the further you get from the torch, so those overlapping areas are not necessarily the brightest spots because they're the sums of less light overall.

It is good that you've dropped the dithering for now and are focusing on the shapes of the light, that makes things easier :D You can always add dithering later.
Here's a probably-not-physically-correct edit:

Most importantly, look at how much light the columns get compared to everything else. They're the closest to the fire, they get the most light. Everything else should be dimmer in comparison. (The thin highlight lines on the columns are the column ridges being highlighted, they have nothing to do with the shape of the flames.)
Notice how there's a shadow spot in the middles of the first few steps, and areas of less light. away from the middle. This makes it look like there are two light sources interacting.

This is all simpler to illustrate on the flat wall (I removed the texture for clarity). Start with the illumination created by one torch:

Note: these examples have incorrect shapes for the light, I just wanted to quickly illustrate how it works; the correct shapes would be circles with the torch at their centre. In addition, I used the available palette for the circles just to be able to show more circles, in reality the brightest colour probably wouldn't reach the wall at all.
Concentric rings of light clearly show the fall-off. You could smooth these with dithering, but I recommend saving that for a final polish step.
Then, copy this for the other torch, and add the two:

Things to notice:
- the irregular shape of the brightest part. The two slightly-weaker rings of light add up, creating a spot in the middle that's as bright as the two brightest circles of light.
- The faint light from the other torch slightly fills in the cast shadow from the column, it's not just a solid dark area.

Though you don't need to, you could extend this to more distant "slices" of the spheres of light in order to "calculate" the lighting on the stairs. I think once you understand how to do it on just a wall though, you should be able to guesstimate it without going all out. Just don't forget that the light falls off with depth too, which basically translates to the light-circles getting smaller/dimmer, and the brightest part of the circles will disappear pretty quickly.
« Last Edit: May 09, 2018, 02:42:15 pm by eishiya »

Offline Hoogo

  • 0001
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile

Re: Tips on animating any moving light source e.g. fire?

Reply #8 on: May 09, 2018, 04:18:24 pm
Waw. First of, thank you so much for your time. This must have taken you a good moment.

All of what you mentioned makes sense, and hearing/reading it now, I wonder how I could not think about such
logical things. I guess I was concentrating too much on the animation without having in mind the Finished product
as well as the image before-animation. Hence the lack of reasoning on perspective, and lighting.

Although I made this piece strictly for fun, I'll keep working on that, it's probably a very valuable study for me to
spend time on.

I'm just wondering, about what you said:
Quote
Just don't forget that the light falls off with depth too, which basically translates to the light-circles getting smaller/dimmer, and the brightest part of the circles will disappear pretty quickly.
Is there a rule, or even personal preference whereas which colour to pick in this case and how. E.g. The dimmer the light obviously lighter colour and less saturated but what about the hue shift, does it have any relevance, or which looks better?

Online eishiya

  • 0100
  • ***
  • Posts: 1131
  • Karma: +2/-0
    • DerpTree
    • http://pixeljoint.com/p/28889.htm
    • eishiya
    • View Profile
    • Webcomic: Black Dram

Re: Tips on animating any moving light source e.g. fire?

Reply #9 on: May 09, 2018, 05:08:21 pm
In real life, hue-shifting comes from the interplay of many coloured light-sources, as there is rarely only one, and it's rare for all the lights in an environment to be exactly the same (plus, light bounces around the environment and that affects its colour). In art, you can do whatever you want, and you can often get away with nonsense as long as it looks nice.

In general, I hue-shift the light towards the hue of the light, and I hue-shift the shadows towards the hue of the ambient light, which is determined by the environment, it's the colours that the light picks up as it bounces around the environment. Sometimes, I pick the ambient light arbitrarily, just something that looks nice (often, the complement of the light source colour).

If you're wondering how to figure out the intensity of the light as you go deeper into the scene rather than just left/right, it's just taking slices through the sphere of light: