Assigning Level Of Detail (LOD) to a particle system

In Cascade, an LOD keeps the settings of level of detail for the particle system. LOD ranges define the point of change between set levels of detail, based on distance from the camera. Using LODs can reduce the processing load for the visual effect. The idea is to have optimal performance but maintain persuasive quality at close range, and smoothly ramp up the detail as the viewer gets closer to the Emitter actor. When passing the range, the transition between LOD settings should not be noticeable.

Getting ready

A little theory is probably a good thing to start with here. To take a particle system and create LOD variants, begin by selecting Regenerate Lowest LOD, to clear out any pre-existing levels. The lowest LOD is automatically generated from the highest LOD with a lower spawn rate. All the modules in the system will be grayed out, but can be edited per LOD by turning them back on to tweak their values to suit the current LOD. Before you start, it may help to read the UDN information about this topic, noting that it appears to be an incomplete system: http://udn.epicgames.com/Three/CascadeUserGuide.html#Cascade LOD Controls. In the documentation example each LOD is given a numbered sprite, so you can really see the difference in the levels to be sure they are working. It is important to understand that in your game, particles may behave a little differently than in the Cascade Editor. In terms of world space, the most likely choice when you are setting your LOD distances is to use Automatic mode, which is called PARTICLESYSTEMLODMETHOD_Automatic , as this will work out the Emitter distance from the camera at spawn time and as well as each time it loops, if looping. The distance is then compared to an array of distances to see which it should use. It also includes a time setting to control how often the array values will be re-checked.

Open the map Packt_07_ColorChange_DEMO.UDK.

How to do it...

  1. In the scene an Emitter actor has already been placed. Select it and press F4 to open its properties. Scroll down to the LOD section and expand it. You will notice the list there includes the choice we mentioned above PARTICLESYSTEMLODMETHOD_Automatic. This is actually an override, taking over whatever method has already been set in the Emitter in the Cascade Editor. Recently a new method has been added, called ActivateAutomatic mode. This and Direct mode, are best set in code.
  2. Click on the scene Emitter actor and press Ctrl + B. Right-click on the browser thumbnail and choose Properties... and expand the LOD section here. This shows the Distances array, which for now probably contains only one entry. Now right-click on the browser Particle System and choose Create a Copy... and call it YOURFOLDER.Cascade.ChangeColorLOD_Test or something similar.
  3. Double-click the browser thumbnail to open the copied asset in Cascade. At the top of the Cascade Editor click the Edit menu and choose Regenerate lowest LOD. Since you only had one LOD to start with, this doesn't do a great deal.
  4. The LOD controls that let us assign more levels are at the right of the icon row.
    How to do it...
  5. Click on the icon Jump to Highest LOD Level [ How to do it... ] and then press Add LOD Before Current, alongside [ How to do it... ]. Do so until the Total feedback says Total=3.
  6. Next to Total=3 is a number which shows the current level. Observe that 3 is the lowest, and 1 is the highest. You can tell from the watching the spawn rate change in the Preview: ColorChange window.
  7. Deselect any modules in the particle system and look at the properties panel. It should show an LOD section, and now you'll have more than one entry in the LODDistances array. Note that while your LODs number 1,2,3 your LODDistances entries number [0],[1],[2]. [2]=LOD 3 and gives the range for the furthest distance. It should be at 2500 currently. Set the distance for [1] to 888.0.
    How to do it...
  8. At level 3, the module settings are grayed out except for spawn, which has settings unique to this level. If you want to change other modules, you can right click on them and choose Duplicate Highest LOD or Duplicate next higher LOD. This will copy the value from that level and allow you to change it in here. For our example, on level 3, access the Initial Size module's properties, and set the Start Size | Distribution | Max XYZ to 75 and Min XYZ to 55 to make the somewhat sparser spawning particles larger.
  9. For level 2, repeat this step but set the Max XYZ to 55 and the Min XYZ to 45, and for the highest level set the Max XYZ to 45 and the Min XYZ to 35. The idea here is that since now we are seeing more particles, they can be smaller and more detailed.
  10. Go back to level 3, and set the Spawn | Rate | Distribution | Constant to 4.0 to better match the streamed look of the highest level, which has a rate of 20.
    How to do it...
  11. As shown in the scene, in the top view, use the middle mouse button to measure the distance 888 units across the ground and place a copy of the existing Emitter actor around about that distance from the first. Then measure 2500 units across from the first Emitter and place another copy at that distance. The idea here is to reproduce the Emitter at distances matching those in the Distances Array so the LODs will all be showing as specified. Rebuild and PIE to verify the effect.
  12. The scene Packt_07_LODSetting_DEMO.UDK shows this using colors to highlight the difference LODs. This is only clear in PIE, not in the perspective viewport, as in the viewport only the current LOD is shown. Actually, color change is not that useful in an LOD setting because it doesn't improve performance, unless perhaps you are trying to desaturate color in the distance to enhance depth in the world space.
    How to do it...

How it works...

An LOD, in Cascade, is just a copy of the main Emitter with changed values, usually reduced incrementally, so that particles further away have less computation without giving up the illusion of detail. In this example, for instance, we scaled up the distant particles size to compensate for their being fewer of them. Because the distance for the LODs proceeds in steps across a threshold, you may notice jumps in the graphics as you cross that threshold. That is where the true skill of LOD design comes in. In the provided map, if you walk forwards you will see an abrupt jump as the color changes, while the transition of the size and count for the LODs is fine.

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

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