Creating a scanning effect

This recipe continues on from the previous one. Open the scene Packt_09_DepthBiased_Start.UDK. You will see a large pool and an enclosed passageway, both filled with objects. What we're interested in is the Material for the energy field in the passageway. It should sweep over the objects (as it's already animated in a Matinee). When the surface touches an object, we're going to make the surface of the energy field glow where contact occurs.

How to do it...

  1. In the Content Browser, right-click and choose New Material. Call it Yourfolder.Material.DepthScanner. In the passageway in the scene, select the Mover that goes back and forth (InterpActor_0). Apply your new Material to it.
  2. Open the Material. Set its Lighting Model to MLM_Unlit and its Blend Mode to BLEND_Translucent.
  3. Hold L and click to add a Lerp; name it Emissive. Hook this Lerp up to the Material's Emissive channel.
  4. Hold 3, click to add a Constant 3 Vector, and set it to R = 20, G = 1, B = 1. This serves as the brightness boost for the Rim of the Material. Add another Constant 3 Vector and set it to R = 0.66, G = 0.12, B = 0.1. This serves as the basic Color of the Material.
  5. Right-click and choose Depth | New DepthBiasedAlpha and hook it up to the Alpha input of the Lerp Emissive. Set the Bias Scale value to 100. This determines the spread of the energy field's rim. Hold 1 and click to add a Constant and set its R value to 1.0. Feed the Constant into the Alpha input of the DepthBiasedAlpha.
  6. Hold L and click to add another Lerp, and name it Opacity. Hook it up to the Material's Opacity channel. Feed the Constant with a value of 1.0 into the A nub of the Lerp.
  7. Right-click and choose Depth | New DepthBiasedAlpha again, and set its Bias Scale value to 5.0. Hook up the Constant with a value of 1.0 also into this DepthBiasedAlpha, into its Alpha nub. The Constant feeds three nodes. Feed the DepthBiasedAlpha's output into the Alpha nub of the Lerp Opacity. Finally, hold 1 and click to another Constant and set its R value to 0.25, and hook it up to the B nub of the Lerp Opacity. This value drives the overall transparency of the Material, besides the Rim.
    How to do it...
  8. Open the View | World Properties menu and set the Game Type for PIE to UTGame. Compile, and PIE to see if the scanner, as it passes along the passageway, brightly outlines the surface of objects it passes over. Press Tab and type in behindview to see it effect the player bot too (although you may have to be running at the time because the player is pretty small and the scanner moves fairly quickly).
    How to do it...
..................Content has been hidden....................

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