Emissive lighting

This scene reproduces the Cornell box commonly used for CG rendered lighting tests and exploration. In this case, rather than use light actors in the scene, we'll see how far we can get by just using the Emissive property of a Material assigned to a BSP in the scene. There are numerous cases where this would be a good way to go; it all boils down to being able to get realistic dispersion of light around the form of the light source. If your light is a cable or tube, or is enclosed (as shown next) then it is inefficient, and sometimes difficult, to manage several PointLights spread around the area.

Emissive lighting

Getting ready

Load the provided map Packt_08_CornellEmissive_Start.UDK. There are two BSP boxes in the scene and a PlayerStart actor.

How to do it...

  1. Select the BSP floor surface, right-click, and choose Select Surfaces | All Matching Brush (Shift + B).
  2. In the Material Editor, highlight the Material Packt.Material.Packt_CornellBase and then right-click in the editor and choose Apply Material: Packt_CornellBase.
  3. Now select the side wall and from the Content Browser apply the Material Packt.Material.RedWall, which just has a Diffuse input from a Constant 3 set to R=0.5, G=0, B=0, and a slight Emissive to brighten it up. For the other side wall, apply the Material Packt.Material.GreenWall, similarly.
  4. Select the surface of the box in the ceiling, then press Shift + B to select all the surfaces of the brush. In the Content Browser, highlight Packt.Material.HotLight and in the scene, right-click and choose Apply Material: HotLight.
  5. With this still selected, press F5 to open the Surface Properties dialog. In the Lightmass Settings section turn on Use Emissive For Static Lighting. Set the Emissive Light Falloff Exponent to 0.33 and, above, turn on LightingChannels | Static and Dynamic as well as the default BSP.
  6. Build and PIE. At the moment you will notice some red and green color spill, or radiosity, across the ceiling, but it looks quite blotchy. Back in the Surface Properties dialog, set the Lighting | Lightmap Resolution to 2 for all the scene surfaces and build again. It will take longer, because tightening up this value generates a larger Lightmap. A value of 2 means there is one Lightmap every 2 units. Here a small value will give more precise results. Mainly, shadows will be better. PIE again, and this time you should notice the ceiling has much smoother gradients. You may also want to switch from the quick and average looking Preview quality build to the slower but better looking Production quality setting for Build Lighting.
  7. Experiment with scaling and moving the ceiling lamp BSP, adjust the Emissive Light Falloff Exponent, and change the base gray wall Material (try out the Packt_Glossy and Packt_Matte Materials).
  8. In the Content Browser search for a Prefab called Packt.Prefab.PrefabBuckyBalls. Place this in the scene on the floor, directly under the light. The meshes will help to show the color spill more clearly, since the empty room doesn't really reveal that much. Light has to hit various objects and cast shadows to look interesting.
  9. An experiment at this point, in sampling for UDK, could be to subdivide the BSP walls by pressing Shift + F2 and select and wall edges then use the Split option. If you need to alter the Material or surface properties for the subdivided BSP walls, in this case, you can select all the parts of one wall surface by choosing one square then right-clicking and going Select Surfaces | All Coplanar. To make sure the red spill and green spill work correctly, you may need to set for the walls the property EmissiveLightExplicitInfluenceRadius to 500 or so.
    How to do it...
  10. To improve the look of the lighting there are some world Lightmass settings we can bump a little, in particular the Ambient Occlusion, which is globally set. Go to the View menu and choose World Properties. Expand the Lightmass section, and locate the option to Use Ambient Occlusion and tick that. What we've done here is allowed shadows to be calculated for areas around objects that occlude, or block, the ambient light. This topic is discussed in more detail later in this chapter.
  11. If you have the time, do a rebuild each time you change a major setting to compare the change. Turn on Enable Image Reflection Shadowing just to see the difference; in the real world, reflective surfaces don't receive shadows as obviously as non-reflective surfaces, but having it turned off, UDK can make a surface look like it is receiving no shadows. Set the Num Indirect Lighting Bounces to 5. As the rollover tip for this property explains, values above 3 or 4 come virtually free but it can be hard to see the difference. This is really worth doing as a comparison. To do so, screen grab (Prt Scr) your builds to Photoshop (Ctrl + N then Ctrl + V) and overlay them and step through the layer visibility to compare the images).
  12. Set the Static Level Lighting Scale a little lower, around 0.9. This value approximates world scale relative to level lighting, and will affect scene dependent values in the lighting. If you raise it very high your scene will brighten. If you reduce it quite low the scene will take much longer to build.
  13. Another factor to consider is that the soft shadows from a surface emitting light will not show up well on other surfaces that are also emitting light.
  14. We used a BSP surface for Emissive lighting. Now try a StaticMesh. Delete the BSP ceiling lamp, rebuild, then place a scaled down sphere in the scene, such as Packt.Mesh.BouncyBall and assign it the Material Packt.Material.HotLight. With that selected, press F4 to go set its Lightmass | Use For Emissive Lighting property to be on. Under the Lighting | Lighting Channels section, turn on the checkbox to use with BSP and Static. With no other lights in the scene, you will be able to see how a small light surface can transmit a lot of energy.
    How to do it...

How it works...

There are three main contributing factors to basic lighting quality in UDK: Emissive lighting (as an area light effectively) from a Material onto an object is just one, light from PointLights and DominantDirectionalLights and their shadows, and finally, Ambient Occlusion, where indirect lighting is blocked by objects encroaching on each other. We explore this in a later recipe in this chapter. Besides Lightmass settings, there is a World Info setting that could make a difference, as well as the maximum Packed Light and Shadow Map Texture Size.

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

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