Controlling sort order for translucent Materials

Most particle emitters contain Materials with a translucent channel. If you have a few different particle Emitters overlapping, along with scene objects that also have translucent Materials, such as water or glass, you may see strange defects in the way the overlap occurs, as if objects behind are rendered in front. UDK requires us to set the priority of overlapping objects using, or the sort order, in the properties of each Emitter or object with a translucent Material. In the example, we're going to examine a simple waterfall scene with mist and swimmable water that has already been laid out, but needs the sort order fixed up.

Getting ready

Load and build the map Packt_07_SortOrder_Start.UDK and familiarize yourself with the layout. Notice that the waterfall is comprised of several Emitters stacked close to each other at the top and bottom of the waterfall.

Getting ready

How to do it...

  1. Some of the particles cut through the water surface, which makes their effect look a little cramped. We'll fix this for each Emitter. Meanwhile, try selecting the water mesh in the perspective view. It probably won't respond. At the top of UDK's interface there is an icon [ How to do it... ] to allow direct selection of translucent surfaces in the viewport. Turn this on. You can do this from the View menu too, by clicking Allow Translucent Selection.
    How to do it...
  2. Select the water surface. This time it should be okay to do so, but there are a lot of transparent particle Emitters above the water mesh, so it is possibly best in this case to use the Edit | Find Actors tool [ How to do it... ] to grab it if clicking directly on it still doesn't work. The actor is called StaticMeshActor_44. You can also select the object in wireframe mode (Alt + 2) more readily.
  3. Look at the misty cloud rising above the waterfall. It bisects the water surface, creating an edge. A way to handle the problem is with a Depth Priority Group change. This can be adjusted by setting their property Static Mesh Component | Rendering | Depth Priority Group from the default: World to: SDPG_UnrealEdForeground. In the waterfall scene, this is the solution for dealing with the misty cloud, which comes from Emitter_14. As seen in the following screenshots from another scene, the adjusted setting is shown on the right-hand side:
    How to do it...
  4. There is a limitation when using this solution. To illustrate it, select the yellow beam. Navigate the view so you are looking through it at the water and notice that where it crosses in front, the beam goes gray, as in the image below on the left. This could be fixed by setting it to have SDPG_UnrealEdForeground turned on, but then, if you view the beam from below the catwalk it is visible through the catwalk mesh, as shown in the next screenshot on the right. So what worked for the smoke doesn't work so well for the beam.
    How to do it...
  5. One related concern is that overlapping transparent content requires multiple draw calls to the same pixel on the screen, which demands more processing, and the larger the particle the more likely you'll have multiple screen draws. So it is good to keep the overall particle count under control. In the next screenshot, the left side shows the shader complexity (Alt + 8) of many overlapping particles, from an emitter with a high spawn count, and on the right there is a heavily reduced amount of particles. A darker value is better.
    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.12.84.150