Author Topic: Preset Help - Scrolling Fire  (Read 2286 times)

Offline Komoe

  • Experienced Traveler
  • **
  • Posts: 134
  • Country: ca
  • Floof-O-Meter: 9
    • View Profile
Preset Help - Scrolling Fire
« on: February 06, 2017, 02:05:10 pm »
Hey everyone! ;D

So, before I start working on a preset I thought about, I've been trying to do some planning. And I'm a little stumped on this one part.

See, I want to make it so the feet look like they are on fire. Perhaps the eyes and inside of mouth. Also, the mane. That's the idea. I want the fire to move, too. So I'm thinking maybe scrolling is what I'm looking for? This is also going to be the first time I've ever done a scrolling preset, so I don't fully have a grasp of it yet. I have a vision for this preset! I just don't really know the best way of going about doing it.

I have the coding! I'm perfectly okay there! However, most of the examples of the scroll.png files that I have seen use a gradient. Here is the example on Ruby1234's coding for beginners thread:



As you can see, the gradient is mostly linear, up and down. If I made this in fire colours, it wouldn't look very realistic, right? But what if I made it jagged? Maybe with more of the flame shape? Do you think that would work?

So, here are my questions:
  • How would you personally go about making this? (Is scrolling the best option? What would you do if you wanted moving flames?)
  • If you think scrolling could work, describe what you think the scroll.png file design should be? (I can try and recreate that.)
Any input would be appreciated! It will save me a lot of time from trial and error ;D 

Offline razmirz

  • The Janitor (Please contact other members of staff if necessary they will escalate issues to me)
  • Immortal Legend
  • *****
  • Posts: I am a geek!!
  • Country: gb
  • Floof-O-Meter: 302
  • Soul Nomming Goodness
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #1 on: February 06, 2017, 03:29:21 pm »
I might weigh in on this since fire is a rather popular request. Now I'm not saying the following is the best way to achieve what you want. And no I've not tested it but I'm 99% sure it can be done with the right code. So here goes.

A quick google search found me this which should give you an idea for a base texture (note your texture should tessellate horizontally).



Now we want to make it live.

So say we add it 3 times over as 3 passes. The top two layers we want to make transparent but we are not going to mess with adding alpha to the images they are fine as they are. Instead of using "scene_blend alpha_blend" try out "scene_blend add" this will make black and anything dark transparent keeping only the light of the flames. I also suggest setting "emissive 1 1 1"  This basically means the fire emits its own light and does not require an external light source.

Let's add some movement; fire rises and falls so our fire should do the same I recommend the "wave_xform" function specifically "wave_xform scale_y sine" what this will do stretch the texture up and down. The actual code for it would be something like

"wave_xform scale_y sine 1 0.2 0 2"

Where
1 is the minimum scale
0.2 is the transition speed
0 is starting position
2 is the maximum scale

Each layer needs to be different for full effect.
To add some left and right movement use the same format but instead of "scale_y" use "scroll_x" which will have you flames that are moving up and down also shifting left and right.

Hope this helps

Raz
Please contact other members of staff if necessary they will escalate issues to me

Offline Komoe

  • Experienced Traveler
  • **
  • Posts: 134
  • Country: ca
  • Floof-O-Meter: 9
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #2 on: February 06, 2017, 05:45:09 pm »
Thank you Raz!

I know much of the coding you mentioned, but some of the code is new to me. I have the scene_blend add in there, however, this preset's fur colour is also black. Perhaps this would be problematic?


Let's add some movement; fire rises and falls so our fire should do the same I recommend the "wave_xform" function specifically "wave_xform scale_y sine" what this will do stretch the texture up and down. The actual code for it would be something like


"wave_xform scale_y sine 1 0.2 0 2"


Where
1 is the minimum scale
0.2 is the transition speed
0 is starting position
2 is the maximum scale
I've never seen code for movement before! So I'm not sure where I should insert that into the .mat file.

You DID mention several layers. I've done a preset before with glowing markings before, which required two layers. Could you give me the details as to what each layer's purpose would be?

So let's say I have the fire picture that you sent me for scrolling as preset_5scroll.png. I remember that when I made glowing markings, I had to put those markings on a transparency, which I called preset_5glow.png, and then made that layer emissive. In code, how would I do that to the preset_5scroll file instead?

Here is what the code looks like. It's probably got a few kinks.
Code: [Select]
material preset_5_bodyMatL
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5bodyglow.png
   }
  }
 }
}
material preset_5_bodyMatR
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5bodyglow.png
   }
  }
 }
}
material preset_5_headMatL
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5headglow.png
   }
  }
 }
}
material preset_5_headMatR
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5headglow.png
   }
  }
 }
}
material preset_5_eyeMatL
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5eyeglow.png
   }
  }
 }
}
material preset_5_eyeMatR
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5eyeglow.png
   }
  }
 }
}
material preset_5_tailMat
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_5scroll.png
    scroll_anim 0.0 1.0
   }
  }
  pass
  {
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
   {
    texture preset_5tailglow.png
   }
  }
 }
}
material preset_5_maneMat
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   alpha_rejection greater_equal 128
   texture_unit
   {
    texture preset_5mane.png
    scroll_anim 0.0 1.0
   }
   alpha_rejection greater equal 128
   scene_blend add
   emissive 1.0 1.0 1.0
   texture_unit
  {
    texture preset_5maneglow.png
   }
  }
 }
}

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #3 on: February 06, 2017, 05:59:07 pm »
i have done flames before.  Had 2 layers of like, red and orange with a 3rd being red emissive that reflected yellow (gave the flames a nice effect)  i can give you my coding for it if you like and you can rework it to suit yourself. But you might need to make a layer that acts as the mask to not scroll, this one should be jaggerd at the top of where you want the flames to end above the feet.  Unfortunately i am not good enough at masks to figure out if it should be at the top layer or bottom.  Works differently for some objects but i think on presets it's the last layer listed.

material preset_7_bodyMatL
{
   technique
   {
      pass
      {
         scene_blend alpha_blend
         cull_hardware none
         cull_software none
         emissive 0.5 0.5 0.5 1
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_7body.png
         }
      }
      pass
      {
         scene_blend add
         cull_hardware none
         cull_software none
         ambient 0.05 0.05 0.05 1
         emissive 0.5 0.05 0.05 1
         texture_unit
         {
            texture preset_7flame1.png
            scroll_anim 0.5 -1.0
            tex_address_mode wrap
                 filtering trilinear
         }
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_7flame2.png
            scroll_anim -0.6 -1.0
            tex_address_mode wrap
                 filtering trilinear
         }
      }
      pass
      {
         scene_blend add
         cull_hardware none
         cull_software none
         ambient 0.4 0.6 0. 1
         emissive 0.5 0.05 0.05 1
         texture_unit
         {
            texture preset_7flame3.png
            scroll_anim 0.7 -1.0
            tex_address_mode wrap
                 filtering trilinear
         }
      }
   }
}

(How to make code box?)
« Last Edit: February 06, 2017, 06:06:47 pm by Kuri »
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #4 on: February 06, 2017, 06:09:38 pm »
*Posts & then finds my post is way out of date*  Oh..  i guess if you applied the movement to the mask layer that'd give it a more dynamic look.
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Komoe

  • Experienced Traveler
  • **
  • Posts: 134
  • Country: ca
  • Floof-O-Meter: 9
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #5 on: February 06, 2017, 06:17:48 pm »
Quote
i have done flames before.  Had 2 layers of like, red and orange with a 3rd being red emissive that reflected yellow (gave the flames a nice effect)  i can give you my coding for it if you like and you can rework it to suit yourself. But you might need to make a layer that acts as the mask to not scroll, this one should be jaggerd at the top of where you want the flames to end above the feet.  Unfortunately i am not good enough at masks to figure out if it should be at the top layer or bottom.  Works differently for some objects but i think on presets it's the last layer listed.

Thank you for your code Kuri! I noticed that you had 2 flame layers...did they look different from one another?

perhaps this is all really hard to grasp because I haven't done it before...I still need to figure out what I would need several layers for. What each one would do. I have a grasp of layers when making glowing markings! One layer is your base fur, the other is your glowing markings on top of it. Could you maybe tell me a little more about your multiple layers?

Again, thank you for taking the time out of your day to help me out! ^_^ I really appreciate it

Offline Komoe

  • Experienced Traveler
  • **
  • Posts: 134
  • Country: ca
  • Floof-O-Meter: 9
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #6 on: February 06, 2017, 06:20:37 pm »
it looks like I had more questions than I thought >_<

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #7 on: February 06, 2017, 07:14:38 pm »
Yes each flame layer was slightly different and had little lines removed near the edges to give a dynamic living flame look.   The one that appears as the static flames like Razmirz said would be a good mask that doesn't scroll.  i think the flames1.png was acting as the mask so if you wanted to keep the flames at the feet & eyes that's where you'd put your masks without scrolling.  The other layers except for the presetbody would scroll.

i could be wrong though.  Maybe i'll experiment & see how it goes.

Edit: OK my experiment shows it was flames1 appears to be the mask this time so that'd be the one to use the flame thing Razmirz showed, but you can simplify it down to a silhouette and have the flames on top as the actual texture.
« Last Edit: February 06, 2017, 07:28:53 pm by Kuri »
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Komoe

  • Experienced Traveler
  • **
  • Posts: 134
  • Country: ca
  • Floof-O-Meter: 9
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #8 on: February 06, 2017, 08:06:58 pm »
Yes each flame layer was slightly different and had little lines removed near the edges to give a dynamic living flame look.   The one that appears as the static flames like Razmirz said would be a good mask that doesn't scroll.  i think the flames1.png was acting as the mask so if you wanted to keep the flames at the feet & eyes that's where you'd put your masks without scrolling.  The other layers except for the presetbody would scroll.

i could be wrong though.  Maybe i'll experiment & see how it goes.

Edit: OK my experiment shows it was flames1 appears to be the mask this time so that'd be the one to use the flame thing Razmirz showed, but you can simplify it down to a silhouette and have the flames on top as the actual texture.

Again, thank you!

So let me get this straight...so you have preset_7body.png acting as your body base. That's your fur. To have fire on your feet, you would simply erase the parts on preset_7body.png where you want the flames to show.

preset_7flame1.png is static. Just a picture. It doesn't scroll, and it appears on the feet. Am I assuming correctly that, just like glowing markings, this is a transparency with the picture of the flames set on the area of the feet?

preset_7flame2.png and preset_7flame3.png are both scrolling material. So, they are like the picture that Raz posted, slightly different from one another. These are the things that move scroll in those patches that were made on preset_7body.png.

Do I have this all correct?

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Preset Help - Scrolling Fire
« Reply #9 on: February 06, 2017, 08:24:30 pm »
Almost correct.  The body base doesn't need anything erased from it.
The flame1.png can be static yes.  But if you want you can add the "wave_xform scale_y sine 1 0.2 0 2" under the 'texture flame1.png' line and it'll look more awesome.
The flame3.png will need that mask added again, i think.

So more like
material preset_7_bodyMatL
{
   technique
   {
      pass
      {
         scene_blend alpha_blend
         cull_hardware none
         cull_software none
         emissive 0.5 0.5 0.5 1
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_7body.png
         }
      }
      pass
      {
         scene_blend add
         cull_hardware none
         cull_software none
         ambient 0.05 0.05 0.05 1
         emissive 0.5 0.05 0.05 1
         texture_unit
         {
            texture preset_7flame1.png
            wave_xform scale_y sine 1 0.2 0 2
            tex_address_mode wrap
                 filtering trilinear
         }
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_7flame2.png
            scroll_anim -0.6 -1.0
            tex_address_mode wrap
                 filtering trilinear
         }
      }
      pass
      {
         scene_blend add
         cull_hardware none
         cull_software none
         ambient 0.4 0.6 0. 1
         emissive 0.5 0.05 0.05 1
         texture_unit
     {
         scene_blend add
         cull_hardware none
         cull_software none
         ambient 0.05 0.05 0.05 1
         emissive 0.5 0.05 0.05 1
         texture_unit
         {
            texture preset_7flame1.png
            scroll_anim 0.0 -0.0
            tex_address_mode wrap
                 filtering trilinear
         }
            texture preset_7flame3.png
            scroll_anim 0.7 -1.0
            tex_address_mode wrap
                 filtering trilinear
         }
            texture preset_7flame2.png
            scroll_anim -0.65 -1.1
            tex_address_mode wrap
                 filtering trilinear
         }
      }
   }
}

But reworked for your preset.   (Added an extra layer for added shadowing.  Transparency hides alot of MSpaint style sins so you can add stuff like that and it'll not detract at all.  Should end up looking good.  And if you change the speeds of each one it'll look more 'alive' than just a scrolling transparency.)

This works for me at least.
« Last Edit: February 06, 2017, 08:26:31 pm by Kuri »
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"