{"id":2330,"date":"2024-04-15T18:28:30","date_gmt":"2024-04-15T17:28:30","guid":{"rendered":"https:\/\/www.katsbits.com\/site\/?p=2330"},"modified":"2024-04-15T18:28:30","modified_gmt":"2024-04-15T17:28:30","slug":"dynamic-outdoor-lighting-techniques","status":"publish","type":"post","link":"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/","title":{"rendered":"Outdoor Lighting Principles In idTech4 &#8211; Using Parallel Lights"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Overview_%E2%80%93_The_Different_Types_Of_Lights_Point_Projected_Parallel\" >Overview &#8211;  The Different Types Of Lights; Point, Projected &amp; Parallel<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#%E2%80%98Point\" >&#8216;Point&#8217;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#%E2%80%98Projected\" >&#8216;Projected&#8217;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#%E2%80%98Parallel\" >&#8216;Parallel&#8217;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Outdoor_Lighting_%E2%80%93_Which_Lights_To_Use_For_Outdoor_Maps\" >Outdoor Lighting &#8211; Which Lights To Use For Outdoor Maps?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Setting_Up_Outdoor_Lighting\" >Setting Up Outdoor Lighting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Why_A_Secondary_Parallel_Light\" >Why A Secondary Parallel Light?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Primary_Light\" >Primary Light<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Secondary_Light\" >Secondary Light<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Both_Lights_Together\" >Both Lights Together<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Positioning_The_Secondary_Light\" >Positioning The Secondary Light<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Tying_Up_Loose_Ends\" >Tying Up Loose Ends<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#%E2%80%98Ambient_Lighting_Without_Using_An_Ambient_Light\" >&#8216;Ambient&#8217; Lighting Without Using An Ambient Light<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Ambient_Material_On_Parallel_Lights\" >Ambient Material On Parallel Lights<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Secondary_Ambient\" >Secondary Ambient<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Both_Primary_Secondary_Ambient\" >Both Primary &amp; Secondary Ambient<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.katsbits.com\/site\/dynamic-outdoor-lighting-techniques\/#Outdoor_Lighting_Conclusions\" >Outdoor Lighting Conclusions<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>In the previous tutorial, &quot;<a href=\"https:\/\/www.katsbits.com\/site\/dynamic-lighting-principles\/\" title=\"Dynamic lighting principles\" target=\"_self\" rel=\"noopener\">Lighting principles in idTech games<\/a>&quot;, we ran through what is effectively a process applicable largely to &#8216;<i>indoor<\/i>&#8216; lighting using the default &#8216;point&#8217; light setup; i.e. lighting that makes use of there being a number of light sources available which illuminate a scene using standard volumetric point lighting (more on this later).<\/p>\n<blockquote style=\"background-color: #ddecf3; color: #000;\"><p><b>Download<\/b>: <a title=\"Download source file\" href=\"https:\/\/www.katsbits.com\/files\/lighttypes.txt\">Katsbits Dynamic Light Example<\/a>  (c. 5 KB | *.txt) Rename *.txt *.map and open in Radiant.<\/p><\/blockquote>\n<p>The same principle gets tricky to use for &#8216;outdoor&#8217; scenes precisely because it <i>is<\/i> based on Doom 3&#8217;s standard &#8216;point&#8217; lights; what outdoor scenes need is &#8216;area light(ing)&#8217;, but as Doom 3 doesn&#8217;t have that, this tutorial will discuss a method to approximate it using what&#8217;s available.<\/p>\n<p>As with the previous tutorial it&#8217;s assumed that you know a little bit about editing; how to create, place and edit light entities, and move around the editor. <\/p>\n<h3><span class=\"ez-toc-section\" id=\"Overview_%E2%80%93_The_Different_Types_Of_Lights_Point_Projected_Parallel\"><\/span>Overview &#8211;  The Different Types Of Lights; Point, Projected &amp; Parallel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Lights in Doom 3 have three basic settings all of which are based on &#8216;point&#8217; illumination, that is, light emitting from a point in space rather than a &#8216;volume&#8217; or &#8216;area&#8217; of space.<\/p>\n<ul>\n<li>              &#8216;point&#8217; (&#8216;standard&#8217;)            <\/li>\n<li>              &#8216;projected&#8217;            <\/li>\n<li>              &#8216;parallel&#8217;            <\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"%E2%80%98Point\"><\/span>&#8216;Point&#8217;<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Lights work by basically spherically projecting light from a point in space (the light entities &#8216;point of origin&#8217; [POO] or &#8216;centre point&#8217;) so it fades in a spherical pattern towards the light volumes bounding box limits. This is the most commonly used type of light. Point lights create &#8216;hotspots&#8217; or &#8216;spotting&#8217; if placed to close to surfaces (as shown below).<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/lights_point.jpg\" width=\"428\" height=\"234\" alt=\"point light showing illumination effect\" \/><\/p>\n<p>&#8216;point&#8217; light showing illumination effect<\/p>\n<\/p><\/div>\n<h4><span class=\"ez-toc-section\" id=\"%E2%80%98Projected\"><\/span>&#8216;Projected&#8217;<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Lights work in the same way a spot light works in real life, it shines light from the POO in the direction it&#8217;s pointing; the light volume is a square cone by default although you can alter the &#8216;shape&#8217; of the light itself by using &#8216;masks&#8217; (more on that in another tutorial). Projected lights use an angle of projection &#8211; an angle based on the direction and orientation of the light volumes bounding box relative to the lights POO, light &#8216;projects&#8217; along that axis.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/lights_projected.jpg\" width=\"428\" height=\"234\" alt=\"'projected' light showing illumination effect\" \/><\/p>\n<p>&#8216;Projected&#8217; light showing illumination effect<\/p>\n<\/p><\/div>\n<h4><span class=\"ez-toc-section\" id=\"%E2%80%98Parallel\"><\/span>&#8216;Parallel&#8217;<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Lights flatten the distribution of light across the lights volume rather than spherically project it from the POO like point lights mentioned above. This means all the surfaces contained inside the lights volume receive approximately the same amount of light, there&#8217;s no or very little &#8216;spotting&#8217;. The light isn&#8217;t as bright as the standard point light of the same size and light value (brightness).<\/p>\n<p>Parallel lights also use a &#8216;projection&#8217; angle, but whereas a projected light uses the light bounding box volume to produce this angle, parallel lights use a &#8216;projection point&#8217; &#8211; a small box appears, &#8216;gizmo&#8217;, just above the POO when activating parallel lights which can be moved to various locations independently of the main light entity object &#8211; the distance and angle between it and the POO creates the projection angle along which light is cast.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/lights_parallel.jpg\" width=\"428\" height=\"234\" alt=\"'parallel' light showing illumination effect\" \/><\/p>\n<p>&#8216;Parallel&#8217; light showing illumination effect<\/p>\n<\/p><\/div>\n<blockquote>\n<p><b>Design note<\/b>:  [<a href=\"https:\/\/www.katsbits.com\/files\/lighttypes.txt\" title=\"Download the sample map\" target=\"_blank\" rel=\"noopener\"><b>sample map<\/b><\/a>] save (or copy\/paste) the text from the sample map to your base\/maps folder as &#8216;<i>lighttypes<\/i><b>.map<\/b>&#8216; and then open it with D3edit. Hit F7 to go into and refresh render mode to see the different light types in effect (there&#8217;s a bug in the Doom 3 editor that means parallel lights don&#8217;t display properly, you may find you have to manoeuvre yourself around a bit before you see anything).<\/p>\n<\/blockquote>\n<p>As mentioned above, parallel lights tend to flatten the effect of light quite a bit; it&#8217;s more or less a &#8216;flat fill&#8217; light so everything can be evenly lit. It also reduces the heavy &#8216;spotting&#8217; or &#8216;hotspots&#8217; associated with point lights (visible in the top image) because of the way light is distributed inside the lights volume. This also tends to make parallel lights dimmer than their point light counterparts, so you often need to increase the physical size a parallel light&#8217;s volume well outside the area of a map you want to influence in order to get an equivalent brightness to that of a point light. Keep this in mind when designing maps that have outdoor and indoor areas, you need to keep and eye on <a href=\"https:\/\/www.katsbits.com\/site\/dynamic-lighting-principles\/\" title=\"Dynamic lighting principles\" target=\"_self\" rel=\"noopener\">light volume overlaps<\/a>. <\/p>\n<h3><span class=\"ez-toc-section\" id=\"Outdoor_Lighting_%E2%80%93_Which_Lights_To_Use_For_Outdoor_Maps\"><\/span>Outdoor Lighting &#8211; Which Lights To Use For Outdoor Maps?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The most useful lights for outdoor maps in Doom 3 are parallel lights as they approximate &#8216;soft&#8217; or &#8216;area&#8217; lighting (relative to the Doom 3 engine that is), exactly the type of flat light you get when outdoors. Of course you their use isn&#8217;t exclusively for outdoor areas but rather anywhere you need a good &#8216;fill&#8217; light.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Setting_Up_Outdoor_Lighting\"><\/span>Setting Up Outdoor Lighting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Now that we have the basics covered in terms of what the lights do and which one we need to use, we can move on. The basic setup for most outdoor light situations is as follows.<\/p>\n<ul>\n<li>\n<p><b>Primary parallel light<\/b><br \/>\n                Acting as the main light source, the direction the sun or suns are in the sky which give the angle of projection. This is a &#8216;full&#8217; light in that it should <i>cast shadows<\/i>, diffuse and specular.<\/p>\n<\/li>\n<li>\n<p><b>Secondary parallel light<\/b><br \/>\n                Projecting light in approximately the opposite direction using a complimentary colour to that of the primary light. Essentially this light acts as &#8216;ambient&#8217; or &#8216;background&#8217; light (more on this later) so it should cast <i>no shadows.<\/i><\/p>\n<\/li>\n<\/ul>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_setup.gif\" width=\"428\" height=\"417\" alt=\"'parallel' light setup\" \/><\/p>\n<p>&#8216;Parallel&#8217; light setup &#8211; editor side view<br \/>\n                red = primary<br \/>\n                green = secondary<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Why_A_Secondary_Parallel_Light\"><\/span>Why A Secondary Parallel Light?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The secondary light is actually quite important for a number of reasons, but in a nuts shell it&#8217;s acting as an &#8216;ambient&#8217; light or very loosely as &#8216;radiosity&#8217;, i.e. the way light is &#8216;reflected&#8217; or &#8216;bounced&#8217; off different surfaces in the world adding a softer global &#8216;indirect&#8217; light to everything. It&#8217;s the reason why shadows aren&#8217;t pitch black in real life.<\/p>\n<p>Apply this to Doom 3 and you see it&#8217;s most noticeable effect in &#8216;softening&#8217; shadows cast by objects as well as taking the harshness out of the light produced by the primary light; shadows are no longer pitch black and lighting over all isn&#8217;t quite so hard and of high contrast.<\/p>\n<p>If we pay particular note of the shadows cast by the giant puffball plant on the (lower) right and the cave entrance to the left (cave is out of sight) in the shots below we can see how the primary and secondary lighting method works.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Primary_Light\"><\/span>Primary Light<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In the first image the shadows cast by using just the <b>primary light<\/b> are <b>pitch black<\/b>, you can&#8217;t see the ground surface &#8216;contained&#8217; in the projected shadow volumes because technically it&#8217;s not even being rendered. This is the area we really want to correct so in order to do so we add the secondary light.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_shadows_primary.jpg\" width=\"428\" height=\"234\" alt=\"primary lighting and pitch black shadows\" \/><\/p>\n<p><b>Primary light only<\/b> &#8211; Primary lighting and pitch black shadows<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Secondary_Light\"><\/span>Secondary Light<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The image below shows the effect of the secondary light only. Although there are some highlights and shaded (shadowed) areas there are no cast shadow volumes because that has been turned off for this entity. This is important to do for natural &#8216;sky&#8217; light &#8211; unless of course you&#8217;re doing something whereby you have more than one sun or heavenly body in the sky casting light on the world.<\/p>\n<p>Note also the colour of the secondary light, it&#8217;s on the blue side (gray-blue), the opposite of the orangey-brown colour of the primary light and quite dark at about 1\/3rd the brightness; because it&#8217;s only acting as ambient light it doesn&#8217;t need to be full bright.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_shadows_secondary.jpg\" width=\"428\" height=\"234\" alt=\"secondary light only - 'flatter' light with no cast shadow volumes\" \/><\/p>\n<p><b>Secondary light only<\/b> &#8211; Secondary light only &#8211; &#8216;flatter&#8217; light with no cast shadow volumes<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Both_Lights_Together\"><\/span>Both Lights Together<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When both lights are &#8216;combined&#8217; the effect of the secondary becomes immediately apparent; we can see into the shadows and the lighting of the map has far less contrast.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_shadows_both.jpg\" width=\"428\" height=\"234\" alt=\"primary and secondary lighting together producing a more natural light\" \/><\/p>\n<p><b>Primary and secondary light together<\/b> &#8211; Primary and secondary lighting together producing a more natural light<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Positioning_The_Secondary_Light\"><\/span>Positioning The Secondary Light<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Although the secondary lights volume (the pink outline in the editor) can be placed so it&#8217;s roughly covering the same area as the primary light, it&#8217;s the &#8216;projection points&#8217; position that fairly important here &#8211; this is the &#8216;gizmo&#8217; object mentioned above that controls the axis along which light is projected in relation to the POO &#8211; generally speaking it has to be facing roughly in the opposite direction to the primary light (in top down view &#8211; as shown below); this is essential if it is to have an optimum effect on the shadows. If this isn&#8217;t done you may end up with shading on objects where they wouldn&#8217;t normally be.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_opposites.gif\" width=\"428\" height=\"410\" alt=\"'parallel' light setup\" \/><\/p>\n<p>&#8216;Parallel&#8217; light setup; red = primary; green = secondary<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Tying_Up_Loose_Ends\"><\/span>Tying Up Loose Ends<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The general principle of outdoor lighting is to use two parallel lights set up so they occupy the same amount of space (that often being 50% larger than the map itself) but with two main differences;<\/p>\n<ul>\n<li>              Opposing colours.            <\/li>\n<li>              Opposing projection axis (editor top view).            <\/li>\n<\/ul>\n<p>This will work fine for any &#8216;normal&#8217; set up where the object is to simulate a single &#8216;sun&#8217; or &#8216;heavenly body&#8217; in a sky or large area. If there is more than one &#8216;sun&#8217; then things will get tricky because adding more lights increases the number of rendering passes the engine does for each surface in the map &#8211; one pass per light (<a href=\"https:\/\/www.katsbits.com\/site\/dynamic-lighting-principles\/\" title=\"Dynamic lighting principles\" target=\"_self\" rel=\"noopener\">see previous tutorial for more info on this<\/a>). Obviously you&#8217;ll need to find a compromise in such situations which at some point means <i>approximating<\/i> some sort of representation of the sky light to the player rather than explicitly replicating it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E2%80%98Ambient_Lighting_Without_Using_An_Ambient_Light\"><\/span> &#8216;Ambient&#8217; Lighting Without Using An Ambient Light<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In addition to what&#8217;s been discussed above you can go one step further and increase the &#8216;ambient&#8217; light, without using the ambient light shader, by adding a fog light. This is simply a light entity that has a &#8216;texture&#8217; applied to it called fogs\/basicfog (applied from the light properties editor). It&#8217;s pretty thick by default so just add the following key\/value pairing to the entity;<\/p>\n<ul>\n<li>              key = &quot;shaderParm3&quot;.            <\/li>\n<li>              value = &quot;25000&quot; (distance to opaque &#8211; larger numbers = thinner fog).            <\/li>\n<\/ul>\n<p>What this does is add a light fog to a map that has the visual effect of making everything a little more diffuse and softer, it doesn&#8217;t actually add any more light to the scene but it&#8217;s a useful tool to have in the mappers arsenal as it helps to create even more of an &#8216;ambient&#8217; feel when Doom 3 lights are limited to a single texture\/material being applied to it (unless you write a custom multistage material) &#8211; you can&#8217;t for instance, apply fog to an parallel light, doing so simply turns the light into a default fog volume.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Ambient_Material_On_Parallel_Lights\"><\/span>Ambient Material On Parallel Lights<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you do want to use the ambient texture the good thing about it is that it can be applied and used on parallel lights, fog can&#8217;t, it has to be it&#8217;s own entity.<\/p>\n<p>You can see in the images below the effects of using ambient; shot one shows the light on it&#8217;s own displaying the &#8216;flat&#8217; light that ambient creates on everything, no shading, shadows or specular highlights; it&#8217;s a true &#8216;flat light&#8217;. Shot two shows the two light types combined.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Secondary_Ambient\"><\/span>Secondary Ambient<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This does mean you have to be somewhat careful with it so as not too reveal too much of that flatness as that can break the illusion of light and depth upon which bump mapping relies. Although over exaggerated in the shot below so the effect can be seen, the lights colour value should normally be set closer to &#8216;black&#8217; (relative to the colour you&#8217;re using) than with other lights so you don&#8217;t &#8216;flatten&#8217; objects too much as mentioned above.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_ambient_secondary.jpg\" width=\"428\" height=\"234\" alt=\"Secondary parallel light with textures\/ambient applied\" \/><\/p>\n<p>Secondary parallel light with textures\/ambient applied<\/p>\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Both_Primary_Secondary_Ambient\"><\/span>Both Primary &amp; Secondary Ambient<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Adding the ambient texture to lights doesn&#8217;t have the great a direct effect on cast shadow volumes, it doesn&#8217;t necessarily make them lighter as per above, it does however, have a direct effect on the &#8216;shading&#8217; of the world geometry. It&#8217;s primary purpose is to add a light values to all surfaces to thusly provide a flat light &#8216;baseline&#8217; from which to then add more light detail.<\/p>\n<blockquote>\n<p><b>Design note<\/b>:  It&#8217;s important to understand that &#8216;shadows&#8217; are composed of two elements in Doom 3;<\/p>\n<ul>\n<li>                <b>Object cast shadow volumes<\/b> &#8211; projected shadows volumes cast from objects in relation to light hitting them. The &#8216;ambient&#8217; texture applied to lights tends to have very direct effect on this.              <\/li>\n<li>                <b>Object shading<\/b> &#8211; the &#8216;shading&#8217; or &#8216;darkening&#8217; of the opposite side of an object in relation to a light source. The &#8216;ambient&#8217; light texture has greatest effect on this aspect of Doom 3.              <\/li>\n<\/ul>\n<\/blockquote>\n<p>When both the primary and secondary ambient light are combined, the overall effect in terms of light brightness is approximately the same as when using the two parallel lights mentioned at the top of this tutorial but, there is a striking difference in how the ambient texture effects the shaded side of objects; as can be seen below they&#8217;re quite &#8216;bright&#8217; and well lit.<\/p>\n<p>With this in mind you can see in the two shots below the difference between using a &#8216;proper&#8217; ambient lights Vs the default parallel lights; the light levels are approximately the same and so too is the intensity of the shadows cast by the shadow volumes. The main, and quite marked difference, is in regards to the objects &#8216;shading&#8217;, there&#8217;s quite a difference between the two, most notable on the pod plants.<\/p>\n<div class=\"content_images\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_ambient_both.jpg\" width=\"428\" height=\"234\" alt=\"Primary plus secondary parallel light with textures\/ambient applied\" \/><\/p>\n<p> <b>Primary and secondary &#8211; with ambient texture &#8211; <\/b>Primary plus secondary parallel light with textures\/ambient applied<\/p>\n<p>              <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/doom_3_lighting\/parallel_shadows_both.jpg\" width=\"428\" height=\"234\" alt=\"primary and secondary lighting together producing a more natural light\" \/><\/p>\n<p><b>Primary and secondary light &#8211; without ambient texture &#8211; <\/b>Primary and secondary lighting together producing a more natural light<\/p>\n<\/p><\/div>\n<p>The big advantage of using a parallel light with the ambient texture is that it only effects the shading of geometry; trying to a similar thing using the <i>default<\/i> settings of parallel lights would bleach out <i>everything<\/i>, including the shadow volumes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Outdoor_Lighting_Conclusions\"><\/span>Outdoor Lighting Conclusions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>That&#8217;s basically it, not much to outdoor lighting once you understand what&#8217;s going on and how to use the entities. However, keep in mind that we&#8217;ve only discussed <b>light placement<\/b> and <b>not light optimisation<\/b> for outdoor areas, which has to be done with great care in maps containing big brushwork objects instead of models. <a href=\"https:\/\/www.katsbits.com\/site\/dynamic-lighting-principles\/\" title=\"Dynamic lighting principles\" target=\"_self\" rel=\"noopener\">Because of what was mentioned in the previous tutorial about how light renders and effects surfaces<\/a> you need to keep in mind the light count per surface (r_showlightcount 0\/1) and &#8216;optimise&#8217; as appropriate, models don&#8217;t necessarily need this treatment because they&#8217;re usually constructed from smaller triangular polygons instead of the much larger ones often associated with brushes.<\/p>\n<p>That said, the one &#8216;disadvantage&#8217; about models is that they load and are treated by the engine based on their physical bounding box limits and not &#8216;per-polygon&#8217;. By default models don&#8217;t block and are not blocked by the placement of VISportals (this is a special brush surface that forces a &#8216;break&#8217; in the BSP so that anything past that point doesn&#8217;t get drawn onscreen if it can&#8217;t be seen) so large models that extend beyond VISportal boundaries will continue to be drawn and that means so too the light count of surfaces you can&#8217;t actually see (this is the calculation of them rather than just the drawing on screen).<\/p>\n<p>The upshot of this is that really large models, terrain&#8217;s for example, can be optimised by being cut into smaller sections which results in fewer overheads for the engine at runtime.<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":2331,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[488,515,328,109,108,339,502,25,567,192,558],"class_list":["post-2330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-brush-volumes","tag-dynamic-light","tag-entities","tag-level-design","tag-level-editing","tag-lighting","tag-lights","tag-materials","tag-q4edit","tag-quake-iv","tag-quakeedit"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/posts\/2330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/comments?post=2330"}],"version-history":[{"count":2,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":2333,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/posts\/2330\/revisions\/2333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/media\/2331"}],"wp:attachment":[{"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/media?parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/categories?post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.katsbits.com\/site\/wp-json\/wp\/v2\/tags?post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}