Author Topic: Scrolling Preset Mane  (Read 4661 times)

S. Italy/Romano

  • Guest
Scrolling Preset Mane
« on: October 31, 2015, 10:08:20 pm »
So someone asked me if there was a way to put a scrolling texture on a mane without getting the rectangles on it where the textured planes should be. At first I thought it was only doable through animated textures frame by frame and we all know too much of those make your presets too big for the preset uploader.

However, after reading more about it on the topic, I realized that it was most certainly doable. I was super excited to finally get it after reading some OGRE engine topics and info, especially considering that I'm really curious about the possibilities of coding in general.

So, you will need two things, first off, you'll have to copy the mane mask (the all black one) from the media folder in FH and then you'll need your scrolling texture.

Here's the code for it:

Code: [Select]
material preset_1_maneMat
 {
    technique
    {
       pass
       {
scene_blend alpha_blend
        alpha_rejection greater 128
          texture_unit
          {
            texture preset_1mane (this is the all black mane mask).png
          }
          texture_unit
          {
            texture preset_1mane (this is the all black mane mask).png           
             colour_op alpha_blend
          }
          texture_unit
          {
        texture SCROLLING TEXTURE.jpg
        colour_op_ex blend_current_alpha src_texture src_current
tex_address_mode wrap
filtering trilinear
scroll_anim 0.0 0.1
          }
       }
    }
 }

The way this works it that the very first texture is the one that shows up underneath everything. Then, we apply a mask where the transparent areas are not covered, but the black/coloured ones are. The final texture is what we apply on the coloured areas of the mask. Basically, since the bottom layer is transparent, the scrolling texture is also rendered transparent in the uncovered areas of the mask.


Offline PrettyReckless

  • Elder Grey Pelt
  • ****
  • Posts: 3,285
  • Country: england
  • Floof-O-Meter: 218
    • RecklessAce
    • View Profile
Re: Scrolling Preset Mane
« Reply #1 on: October 31, 2015, 10:15:19 pm »
Omf, yes. I could kiss you right now.
Thank you, this will make my life so much easier while making presets.

There are a lot of people out there who will appreciate it! -Spreads link around.-
RETIRED.

S. Italy/Romano

  • Guest
Re: Scrolling Preset Mane
« Reply #2 on: October 31, 2015, 10:18:25 pm »
It was Kikiorylandia who asked about this in Bonfire yesterday and I promised I'd look it up. After I found it, I figured others might make use of it.

I tested it with a lava texture and it works like a charm. I do hope this makes things easier for people out there.
I myself don't have a preset with a scrolling mane, but I want to make one now X3

I'll test out some more codes when I have free time on my hands. Might pick up a new trick or two.

Offline PrettyReckless

  • Elder Grey Pelt
  • ****
  • Posts: 3,285
  • Country: england
  • Floof-O-Meter: 218
    • RecklessAce
    • View Profile
Re: Scrolling Preset Mane
« Reply #3 on: October 31, 2015, 10:21:26 pm »
Hng, Kiki was the first person I linked it to as she has asked me as well.
I am a mere beginner with coding presets.
I just tested it out as well and it works wonderfully. c': I'm so happy.

I've seen some great presets with scrolling manes, especially if you keep the scrolling slow and don't make it too bright. Tends to look the best in my opinion.
Gonna check with some old friends if they have another code to share, if they have more to come with, I'll share the code with you as well.
RETIRED.

S. Italy/Romano

  • Guest
Re: Scrolling Preset Mane
« Reply #4 on: October 31, 2015, 10:25:54 pm »
Thank you, I do love seeing the use of coding to help people achieve a desired effect, all the more creativity to go around :3
I'm not disappointed with my choice of going into animation, but I might pick up coding shortly after as a hobby.

Offline Kerriki

  • Band Geek
  • Immortal Legend
  • *****
  • Posts: 5,670
  • Country: us
  • Floof-O-Meter: 371
  • Who needs furniture when you have the floor?
    • Kikiorylandia
    • View Profile
    • DeviantART
Re: Scrolling Preset Mane
« Reply #5 on: November 01, 2015, 05:46:18 am »
This is so great, I cannot thank you enough! -Nuzzle-
Farewell everyone<3

Preach

  • Guest
Re: Scrolling Preset Mane
« Reply #6 on: November 01, 2015, 09:59:56 am »
Oh, this is quite handy. Thank you for sharing. <3