Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

"Necrify" Effect Tutorial/Explanation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Necrify" Effect Tutorial/Explanation

    As promised, I've made a couple of example levels for anyone wanting to understand how I made the "Necrify" Effect for CDOM-CBP3-Enslaved.

    I've basically cleaned up the material expressions and grouped them so that they are easier to look at and figure out. I'll explain it a bit here but not in great detail. You should hopefully be able to figure it out from these maps. This tutorial does assume that you are reasonably familiar with kismet, materials etc... it's not really suitable for novices.

    Download: necrify_examples_dom.zip

    Extract the levels to your Unpublished\CookedPC\CustomMaps dir.

    PART A

    1. Open the first map - "DM-NecrifyExample1_DOM.ut3".

    2. First off, just try playing the map from the editor. You start off on a platform where you can see all three "DOM Points", and you can use the three triggers in front of you to Necrify/Un-Necrify each point, or you can jump down and trigger the points by walking into them.

    3. Back in the editor, open Kismet. Note that basically the only things in here are 3 matinees (the other stuff is just to trigger them off for testing purposes). Double click on the first matinee to open the matinee editor. Note how you can preview the effect by moving the matinee timeline slider back and forth. Also note the single matinee track - it expands the Necrify effect outward from the point.

    4. In the Generic Browser, navigate to the DM-NecrifyExample1_DOM package and open the material "Necrify_Base_MAT". This is the material that other materials in the level are instanced from. The effect is created with a Lerp between the "Standard" material, and the "Necris" material (but in this example, I've just used simple colors to demonstrate). The complicated part lies in the mask for this Lerp. No maths lesson from me but basically, each point's XYZ location is set as a vector in the material, and the "max radius" you want the necrify effect to be is set as the alpha channel for that vector. There is a multiplier for each point called "RadiusMultiplyPointX". This is the multiplier that the matinee controls. If it is 0, then the Necrify effect doesn't appear. If it is -1.0 then the Necrify effect/mask will be at it's max radius (the one you set in the alpha channel for that point's vector). There is also some noise applied to the edges of the mask so that it appears "wobbly" (I wanted it to fade out but couldn't think of a non-expensive way). Anyway, the three masks for each point are multiplied together to create one big world-aligned mask that defines where the Necris parts are, and where the standard parts are.

    5. Open the Material Instance "Necrify_Base_MAT_INST". This is the instance that will have its parameters changed by the matinee. All of the materials you apply to your level will be an instance of this instance (that means, when this instance changes, then so do all the ones that are based off it). It has a few parameters you can play with:


    RadiusMultiplyPointA - Controlled by the matinee, the multiplier for the size of point A.
    RadiusMultiplyPointB - Controlled by the matinee, the multiplier for the size of point B.
    RadiusMultiplyPointC - Controlled by the matinee, the multiplier for the size of point C.
    NoiseTiling - The size of the "waves" on the edge of the effect.
    NoiseStrength - The amplitude of the "waves" on the edge of the effect.
    NoiseSpeed - How fast the "waves" on the edge of the effect move.

    PointA - The location of point A.
    PointB - The location of point B.
    PointC - The location of point C.

    Note that the PointA, PointB, PointC vectors in the example are set to the XYZ location of the "DOM Points" in the level (the triggers). These should be set in this material instance and never changed, unless you change the location of your DOM points.

    RadiusMultiplyPointA, B, C shouldn't be changed, as the matinee controls their values anyway.

    You can play with the noise settings to get the desired shape of your effect.

    PART B

    1. Open the second map - "DM-NecrifyExample2_DOM.ut3". In this one, the material is more like the finished effect, and shows how multiple materials are used (and you can copy paste it and use it as a template if you want to implement this effect - it should have everything you need).

    2. Try playing this map from the editor. It works the same as the first map.

    3. Back in the editor, open Kismet. Still the only things in here are the 3 matinees. Double click on the first matinee to open the matinee editor. Note the matinee now has 3 tracks - the additional two are for controlling the emissive edge color and whether it is on or off.

    4. In the Generic Browser, navigate to the DM-NecrifyExample2_DOM package and open the material "Necrify_Base_MAT". Notice this one is a bit more complicated, but it's more complicated than it looks. It's the same as before, but with two main differences: 1. It has a few different Lerps for Diffuse, Specular, Normal etc (though all are controlled by the same mask, like before); 2. It has an additional part added to the mask which is just for the bright glowing edge effect (it's not important to know how it works, it's just some maths!). There are parameters for the standard and Necris versions of each component of the material.

    5. Open the Material Instance "Necrify_Base_MAT_INST". Again, this is the instance that will have its parameters changed by the matinee. All of the materials applied in the level are an instance of this instance. It has a few parameters you can play with, but again the only ones you really want to touch in this material instance are NoiseTiling, NoiseStrength, NoiseSpeed, PointA, PointB, PointC.

    6. Open the Material Instance "Necrify_Example_Changer_01_INST". This is the material instance that is applied to the floor of the level. The parameters that you want to change here are:

    DiffuseTexture - The diffuse texture to use for the "standard" material.
    DiffuseTextureNecris - The diffuse texture to use for the "Necris" material.
    NormalTexture - The normal map texture to use for the "standard" material.
    NormalTextureNecris - The normal map texture to use for the "Necris" material.
    DetailNormalTexture - The normal map texture to use as a detail texture (you could change the material to have one for Necris and one for Standard, but it shouldn't be necessary and the material is already expensive enough.

    SpecularMultiply - Multiplier for the specular channel of the "standard" material (specular is just a multiplied version of the diffuse texture).
    SpecularMultiplyNecris - Multiplier for the specular channel of the "Necris" material.
    SpecularPower - Specular power channel for the "standard" material.
    SpecularPowerNecris - Specular power channel for the "Necris" material.

    Remember the matinee doesn't do anything to this material instance - it changes the instance that this instance comes from!

    7. Open the Material Instance "Necrify_Example_Changer_02_INST". This is the material instance that is applied to the boxes in the level. Notice how it just has different textures applied - the rest is the same as the other instance example, in this case.


    Notes

    • So that's basically it. You just create your level like you would normally, using standard Epic textures, and then afterwards, for each material in your level you create an instance from the base "changer" instance, and set the textures that is uses in there.
    • There WILL be some exceptions - some stock Epic materials are quite complex, and use overlays and things like that. For these you will need to basically copy the Epic material and create a one-off material, copying the "mask" expressions from your base material and using them to Lerp the Epic expressions (it's hard to explain but most should know what I mean). Water is a good example - it has a distortion channel so you'll need to create a one-off material for that. Then you need to create an instance off it just so it can be changed, add a MaterialInstanceActor to your level and point it to that instance, then make an object variable in kismet and hook it up to your matinees. For an example of these one-off materials, you can see CDOM-CBP3-Enslaved (when CBP3 v3 is released). I had to make quite a few exceptions for that one.
    • This material doesn't really work on terrain unfortunately. Weird things seemed to happen like alpha layers all mixing up... and even if it did work, there are too many textures - you can only have 12 textures in a single terrain sector, so you'd only be able to have 1-2 layers. For the terrain I created a DecalMaterial version of the changing material, and added a decal at the DOM point that only affects terrain. It doesn't look as good, because it's modulated, but it was OK.
    • You will need to create a fallback for the material (and any one-off materials you create), which is basically a version that doesn't have this effect ) i.e. you delete the whole mask section and just have a normal material, like the standard Epic one. So anyone that's silly enough to play on a PC that requires these fallback materials just doesn't see the effect.
    • I am making a CTF version of the material at the moment, so stand by for that. It shouldn't need to be so complicated and hopefully won't need the fallbacks... might also fade out. WAR is a bit more difficult. The DOM version would work but it would end up being far too expensive for a WAR map with more than two nodes. I'll see if I can think of something involving matinee a bit more.
    • Oh yea - that's another thing - kismet isn't that reliable. It sometimes breaks, especially when you try to do lots at once. I tried to make it as robust as possible but due to the fast nature of DOM gameplay it can still, very rarely, break.
    • Big props to Zoltan Erdokovy (Metaball) - he came up with the maths behind this spherical mask. If I had not asked him, then it would not spread nicely up vertical surfaces etc like it does now - the mask would have probably been just a world aligned "flat disc".

  • #2
    This is fantastic, thank you So much for this!

    Comment


    • #3
      I ****ing love that effect you threw on Enslaved. The electrical effect that goes along with the necrify effect makes it look epic in addition to the necris spines.

      Comment


      • #4
        Nice tutorial. Thx!

        Comment


        • #5
          WAR is a bit more difficult. The DOM version would work but it would end up being far too expensive for a WAR map with more than two nodes.
          Damnit!

          Nah i might give it a shot on this current WIP war map, 4 nodes total. See if i can modify it to work well.

          I had a look at it in Enslaved after searching the MSUC site ;x The one thing i didnt get then was the world co-ordinates but thats solved now.

          Thanks Spoon

          Comment


          • #6
            thanks for sharing.

            Comment


            • #7
              Hey Spoon

              That effect is very impressive

              THX a lot for sharing this info & to provide very good example with the included maps

              Comment


              • #8
                little over my head, but good stuff. I never knew the mat editor could be used to adjust a texture's location in the world.

                Comment


                • #9
                  This needs to stay on the front page xD

                  Comment


                  • #10
                    Now you are using a world X Y Z to make it apear on that spot, but is there also a way to make that world X Y Z the players position, only the player itself or all the players.

                    because the map i am making would look so mutch more kick ass if i had that effect. (not necri)

                    Comment


                    • #11
                      I wondered about that too but I don't think it's possible without a custom script. First of all it's tough to get the player's location, if it's even possible at all in kismet (the Get Property node barely works), and even then, you'd have to update it periodically - which kismet would probably be temperamental about, and it would look jumpy :/

                      Comment


                      • #12
                        Thank for your share ,can you show more tips about the Position Transform ,the point position?

                        Comment


                        • #13
                          Another thing you can do is break the X,Y,Z,MaxRadius vector into separate channels (and join them with appendvector node). Then you can use a matinee to animate the X, Y & Z locations individually, thereby moving the Necrify point around the map.

                          Comment


                          • #14
                            I did not realy get that material instance part, so you make one, that got all the other materials inside?
                            or is it more as a parent thing, as the parent changes the others will change to, but how do you tell them to link to that one,

                            I would realy like to know, because this effect is damm kick ass.

                            but does this mean that you need to create a instance material of all the materials in the map?

                            Comment


                            • #15
                              I did not realy get that material instance part, so you make one, that got all the other materials inside?
                              or is it more as a parent thing, as the parent changes the others will change to, but how do you tell them to link to that one.
                              You right click on the base material and create new material instance (A) - this is the one that get's its parameters changed by matinee but is still just grey and doesn't have any proper textures applied to it. Then you right click on that material instance and create another material instance (B) - that is the one you apply the textures to and the one that you apply to your world. Any Material Instance (B)'s you create from Material Instance (A) will all change automagically.
                              but does this mean that you need to create a instance material of all the materials in the map?
                              Yes - though obviously you don't have to for any materials that aren't in an area that "changes".

                              Comment

                              Working...
                              X