Creating transitions between Materials

There are a number of ways to transition between two Materials, where a mesh changes from having one to having another. Some Material changes can be sudden, simply using the Set Material action in Kismet. Some transitions can be done using a linear opacity dissolve, where a parameter is animated to adjust a Lerp node's Alpha to weight from A towards B for instance. Others require a more organic blend though, such as a dry to wet transition through spattering rain drops, or a burning transition that crawls over a surface. The method explained here assumes that three Materials will be used: a Material set before the transition, another set during the transition, and another set afterward. The design of the blending is where the creative problem-solving lies, and there are numerous ways to come up with an interesting mask. Masking can reveal an underlying texture, or simple fade out to nothing. A lot of artists blend to transparent using noise textures to hide destroyed items or dead characters. It can also be used for wet, dry, burning, or burnt effects.

How to do it...

  1. Let's start with a kind of burning transition, which is simplified so that the Before surface is red, rather than wood or skin for instance. The After surface is blue, rather than burned wood. You could put any texture you want into the Before or After states. We'll also have a During texture represented as yellow.
  2. So, to get started, in the Content Browser right-click and choose New Material. Call it Yourfolder.Material.TransitionBurn.
  3. Open it in the Material Editor and add a Constant 3 Vector, name it Before, and set it to 1,0,0 and then add another, name it After, and set it to 0,0,1. Add one more, name it During, and set it to 1,1,0 (which is yellow).
  4. Right-click and choose Texture | New FlipBookSample. In the Content Browser search for Packt.Texture.Packt_Burning. Highlight it and then assign it to the FlipBookSample in the Material Editor.
  5. You may cry unfair, since we're using an existing texture. So let's look over how this was generated. In 3ds Max there is a map type called a Gradient Ramp, which is really convenient for making a wiping effect between two colors with noise added. There are quite a lot of steps, but fairly easy ones. Open the Material Editor (M) and right-click in Slate and choose Maps | Standard. Looking in the Gradient Ramp Parameters dialog, you will see a black to white ramp with three flags. At one end click to add flags so that you get a sharp white to black change, with a thin band of gray. Edit the gradient properties to assign a higher Noise Amount and Noise Size value, similar to the example shown in the next screenshot. You may want to squeeze them closer together.
    How to do it...
  6. In the 3ds Max main workspace, press N to turn on Autokey mode and go to frame 15 on the time line (since we're going to render only 16 frames and it counts frame 0). Slide the flags for the gradient ramp along to the white end, keeping their order the same. If you wish, animate the noise values too.
    How to do it...
  7. In the Slate Material Editor, right-click on the map and choose Render map. A dialog will appear in which you can set the output size (256x256) and the file name and path. Render out to Gramp.PNG and set the frame range to 0-15.
  8. In Photoshop, combine the resulting Gramp frames into a tiled FlipBook image. This procedure was detailed in Chapter 7, Hi, I'm Eye Candy! When you import the image into UDK, make sure that you set the FlipBook checkbox on and name it Yourfolder.Texture.Burning (or you can use the provided Packt.Texture.Packt_Burning).
  9. Also in Photoshop, use a white brush and rub out the empty black parts on the left-hand side of the image behind the advancing gradient ramp's noisy edge. This generates a mask for the currently burning part, distinct from the unburned and burned parts, as in the following image:
    How to do it...
  10. Save the result and import it as Yourfolder.Texture.BurningMask. Remember to set the imported texture so the FlipBook checkbox is ticked.
  11. Back in the Material that we've been working on, highlight the FlipBook Sample and press Ctrl + C then Ctrl + V to make a copy of it. In this one, place your imported BurningMask asset (or you can use Packt.Texture.Packt_BurningEdge). Hook up these as seen in the following network screenshot:
    How to do it...
  12. To realize the effect, you will need to make a new Material called Before (which will be red, used for the first surface type in the transition), and another Material called After along the same lines.
  13. Open any map, and apply Before to a new KActor placed in the scene (it must be a dynamic actor or the process won't work), and also place a Trigger. Create a Kismet sequence where a Trigger Touch event fires a Set Material action to swap in the transition Material we've been making on the InterpActor, and then, after a 1 second delay (since the FlipBook frame rate is 16 frames per second) link to another Set Material node which will fire the After Material.
  14. A final note in case your Set Material just doesn't want to work. The KActor is derived from a StaticMesh, and if you see (when you double-click on the StaticMesh in the browser) that its tick box for Can Become Dynamic is off, then you won't be able to get the effect. In the provided example the mesh Packt.Mesh.Card is used. Find this in the Content Browser, note that this setting is on and the effect is working. Turn it off, and the Set Material action reverts the Material to the LOD Material Packt.Material.RotateMesh_mat. The example is found in the map Packt_09_Transition_DEMO.UDK.
  15. In the next screenshot, the Kismet is shown on the left-hand side and the final result is shown on the right-hand side. There is a limitation to the example: its one second duration can only be slowed down by adjusting the FlipBook frame rate, and that introduces jerky motion (more frames would be needed). Also, using Texture Samples as masks means the transition can only do what the source texture does. In the Content Browser, in the Packt content, you will also notice a similar transition mask Packt.Texture.BuildUp.
    How to do it...

See also

For an alternative method to doing transitions, which uses Matinee animation of MIC Parameter nodes, consult the excellent demonstration by Eat3D in their DVD specifically on this topic, Unreal VFX—Material Transitions, from http://eat3d.com/vfx.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.55.42