Making trails with AnimTrail TypeData

Trails can be used for many purposes. They can be attached to machines to create exhaust. They can be attached as floating whiskers to Chinese dragons. How they are made is by drawing steps between particles. A stretchy sprite is interpolated in the space between particles rather than at each particle location. It is not very difficult to create a ribbon effect, but it can be tricky to get it to scale correctly into the scene and animate nicely over its lifetime.

How to do it...

  1. Create a new particle system in your package called MyTrailTest.
  2. In Cascade, set the Required module's settings to Sort Mode: PSORTMODE_Age_NewestFirst so new particles will be in front of older ones, and Sub UV | Interpolation Method: PSUVIM_Linear, with a Sub Images Horizontal and Vertical count of 4. This will mean the SubUV texture we'll use will render out in a linear order, as we discussed earlier in this chapter in the recipe: Using SubUV charts to achieve particle diversity.
  3. Set the Required module's Material setting to PacktFX.Material.SubUVMat, the Material we made in the previous recipe.
  4. As usual, we need to set the spawn, life, size, and speed parameters every particle requires. This time there is nothing remarkable about the ranges used. In the Spawn module, set the Spawn | Rate | Distribution | Constant to 12.0.
  5. In the Lifetime module, set the Lifetime | Distribution | Min to 12 and Max to 24.
  6. In the Initial Size module, set the Start Size | Distribution | Max X=2.0, Y=0.25, Z=0.01 and Min X=1.0, Y=0.1, Z=0.01. Later you can tweak these values, once the ribbon is applied.
  7. In the Initial Velocity module, set the Start Velocity | Distribution | Max to X=1.0, Y=2.0, Z=55 and Min to X=-1.0, Y=-2.0, Z=55. This gives us a rapid upwards motion, and it is important that the Z values for Min and Max are the same or you may get a folding backwards effect in the ribbon, which looks weird here.
  8. Add a Size By Life module, and set the Size | Life Multiplier | Distribution | Constant Curve | Points | [0] | In Val to 0.0, and Out Val XYZ to 2.0 for all three. Set the Size | Life Multiplier | Distribution | Constant Curve | Points | [1] | In Val to 1 and the Out Val XYZ to 0.0 for all three. What this does is make the particle grow a little during its life then shrink at the end.
  9. That's it for the base particle. It probably looks like a lot of square cards going upwards, as in the following screenshot, on the left. The image has had its background color changed to better see the particles. Adding the ribbon trails to this should give us a result in Cascade similar to the image below, on the right:
    How to do it...
  10. Right click under the Size By Life module and choose TypeData | New Ribbon Data. You could also experiment with AnimTrail Data. All that is needed to specify for the ribbon is its stepping values so it isn't too sparse, or chunky. The lifetime and velocity values heavily influence how the ribbon will look.
  11. Set the properties for the Ribbon Data module so the Sheets Per Trail is 1, the Max Trail Count is 1, and the Max Particle In Trail Count is 22. Experiment with changing these values.
  12. Set the properties Enable Previous Tangent Recalculation and Tangent Recalculation Every Frame both on. See what difference it makes to leave each one off.
  13. Set the Rendering | Tiling Distance to 0.3, the Distance Tessellation Step Size to 0.3, and the Tangent Tessellation Scalar to 1.0. You should now have a ribbon that is trailing nicely upwards.
  14. You may also want to experiment with changing the Size By Life module's Size | Life Multiplier | Distribution | Constant Curve | Points | [1] | Out Val XYZ so instead of being 0.0 it is 120, which really fans the ribbon out widely at its end.
  15. Finally, if you can't see the particles start up in the Cascade Editor when you open the particle system, try turning it off and back on again. And now you are done, try changing the Required | Material to see how the effect changes. The provided Material: Packt.Material.Digit0 looks interesting here, or the Material that ships in UDK: UDK_ProceduralSky.Materials.M_Aurora_MASTER.
  16. The map Packt_07_Ribbon_DEMO.UDK shows the Emitter placed several times in a radial pattern to create streamers and these are all animated in Kismet through a Matinee using a DrawScale3D loop to make them shrink and grow. This scene uses ribbon data in the particle system PacktFX.Cascade.RibbonDemo.
    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.18.4