Skip to content

ScatterSky

LuisAntonRebollo edited this page Dec 4, 2013 · 1 revision
<SCRIPT SRC="../../../include/tutorial.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/prototype.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/scriptaculous.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/glossaryLookUp.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/referenceLookUp.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/component.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/componentContainer.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT>DocImagePath = "../../../";</SCRIPT> <script> // this script chunk is to update the ToC to the current doc and expand it pageID = 87; parent.leftFrame.expandToItem('tree2', 'doc87'); var element = parent.leftFrame.document.getElementById('doc87'); if((element) && (element.className==parent.leftFrame.nodeClosedClass)) { element.className = parent.leftFrame.nodeOpenClass } ; </script> <title>Torque 3D World Editor - Scatter Sky</title> <script type="text/javascript" src="../../../include/wz_tooltip.js"></script>
    <table border="0" cellpadding="0" cellspacing="0" width="700">
      <tbody>
        <tr>
          <td width="700"><table id="toc" summary="Contents">
              <tbody>
                <tr>
                  <td><div id="toctitle">
                      <h2>Contents</h2>
                    <ul>
                      <li class="toclevel-1"><a href="#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
                      <li class="toclevel-1"><a href="#Setup"><span class="tocnumber">2</span> <span class="toctext">Setup</span></a></li>
                      <li class="toclevel-1"><a href="#Delete_Existing_Sun_and_Skybox"><span class="tocnumber">3</span> <span class="toctext">Delete Existing Sun and Skybox</span></a>
                      </li><li class="toclevel-1"><a href="#Adding_A_Scatter_Sky"><span class="tocnumber">4</span> <span class="toctext">Adding A ScatterSky</span></a></li>
                      <li class="toclevel-1"><a href="#Scatter_Sky_Properties"><span class="tocnumber">5</span> <span class="toctext">ScatterSky Properties</span></a></li>
                      <li class="toclevel-1"><a href="#Modifying_Brightness"><span class="tocnumber">6</span> <span class="toctext">Modifying Brightness</span></a></li>
                      <li class="toclevel-1"><a href="#Modifying_Scattering"><span class="tocnumber">7</span> <span class="toctext">Modifying Scattering</span></a></li>
                      <li class="toclevel-1"><a href="#Modifying_Colors"><span class="tocnumber">8</span> <span class="toctext">Modifying Colors</span></a></li>
                      <li class="toclevel-1"><a href="#Modifying_Shadows_and_Light_Intensity"><span class="tocnumber">9</span> <span class="toctext">Modifying Shadows and Light Intensity</span></a></li>
                      <li class="toclevel-1"><a href="#Conclusion"><span class="tocnumber">10</span> <span class="toctext">Conclusion</span></a></li>
                    </ul></td>
                </tr>
              </tbody>
            </table>
            <a name="Introduction" id="Introduction"></a>
            <h2> <span class="mw-headline">Introduction</span></h2>
            <p>Torque 3D includes an object called a ScatterSky which uses a dynamic sky coloring system to create more vibrant varying skies than the simple <a href="Skybox.html">Skybox</a> object. </p>
            <p><br />
              As the name implies, the ScatterSky object produces the sky. Additionally, it includes level lighting, sun positioning,
              and a hook for time of day manipulation. This can be used for a fully
              functioning day/night system. </p>
            <a name="Setup" id="Setup"></a>
            <h2> <span class="mw-headline">Setup</span></h2>
            <p>This article was written using a newly generated project with the
              Full Template, which ships with plenty of free assets for testing and
              learning. To save time and focus on this specific section of  the World Editor documentation, we are going to bypass asset creation
              until later on. </p>
            <a name="Delete_Existing_Sun_and_Skybox" id="Delete_Existing_Sun_and_Skybox"></a>
            <h2> <span class="mw-headline">Delete Existing Sun and Skybox</span>
            </h2><p>Every new mission starts with both Skybox and Sun objects. Since the ScatterSky object contains the functionality of those two objects embedded within it they must be removed in order to use a ScatterSky in the level.</p>
            <p><br />
            To delete the existing Skybox, switch to the Object Editor tool and locate your Scene Tree panel. Select the Scene tab. You should see a single Skybox object in the MissionGroup. Select the object and  delete it. </p>
            <p><img alt="Image:DeleteExistingSkyBox.jpg" src="images/DeleteExistingSkyBox.jpg" border="0" height="320" width="206" /> </p>
            <p><br />The Skybox object should no longer be present in the Scene Tree. More importantly, the sky has now been removed from your level. Because nothing is rendered beyond a Skybox, Torque 3D will be rendering absolutely nothing where the object used to exist. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/BlankSky.jpg" class="livethumbnail"><img src="images/BlankSky.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              If your level is currently lit, you can see the terrain. This means there is already a Sun object in your level. Since a ScatterSky also contains its own sun, we will need to clear the level of any conflicts. Just as you did with the Skybox, locate the Sun object in your mission group and delete it. Once you do so, your level should be completely dark. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/NoSkySun.jpg" class="livethumbnail"><img src="images/NoSkySun.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <a name="Adding_A_Scatter_Sky" id="Adding_A_Scatter_Sky"></a>
            <h2> <span class="mw-headline">Adding a ScatterSky</span></h2>
            <p>To create a new ScatterSky, change to the Library tab in the Scene Tree panel. Click on the Level tab and select the Level folder. Locate the ScatterSky entry and double-click it. </p>
            <p><br />
              <img alt="Image:AddScatterSky.jpg" src="images/AddScatterSky.jpg" border="0" height="281" width="207" /> </p>
            <p><br />
              The Create Object dialog will appear. The Object Name is what you want your ScatterSky to be named. It will appear in the MissionGroup of the Scene Tree. Enter <em>theSky</em> as the name, leave the rest of the values at their defaults, then click Create New. </p>
            <p><br />
              <img alt="Image:NameScatterSky.jpg" src="images/NameScatterSky.jpg" border="0" height="159" width="256" /> </p>
            <p><br />
            A new ScatterSky object will be created and automatically added to your level. Therefore, it will once again have  a sky. Since the ScatterSky supplies a sun, the level should now be lit. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/ScatterSkyAdded.jpg" class="livethumbnail"><img src="images/ScatterSkyAdded.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <a name="Scatter_Sky_Properties" id="Scatter_Sky_Properties"></a>
            <h2> <span class="mw-headline">ScatterSky Properties</span></h2>
            <p><br />
            Additional properties can be changed with the Inspector pane. To change the Skybox properties using the Inspector Pane, click the Scene tab. Then click the name of your new ScatterSky object. The Inspector pane will update to display the current properties of your new Skybox.</p>
            <p>Hover over each section in the image below to see a description of the fields within it:</p>
            <p><br />
               <img src="images/ScatterSkyName.jpg" width="193" border="0" height="80" onmouseover="Tip('<strong>name</strong>: <i>TypeName</i>. Optional global name of this object.<br><br><strong>id</strong> : <i>TypeCaseString</i>. SimObjectId of this object. Read Only.<br><br><strong>Source Class</strong> : <i>TypeCaseString</i>. Source code class of this object. Read Only.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyTransform.jpg" width="193" border="0" height="76" onmouseover="Tip('<strong>position</strong>: <i>MatrixPosition</i>. Object world position.<br><br><strong>rotation</strong> : <i>MatrixOrientation</i>. Object world orientation.<br><br><strong>scale</strong> : <i>Point3F</i>. Object world scale.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyObject.jpg" width="193" border="0" height="146" onmouseover="Tip('<strong>skyBrightness</strong>: <i>TypeF32</i>. Global brightness and intensity applied to the sky and objects in the level.<br><br><strong>mieScattering</strong> : <i>TypeF32</i>. Affects the size and intensity of light scattering around the sun.<br><br><strong>rayleighScattering</strong> : <i>TypeF32</i>. Controls how blue the atmosphere is during the day.<br><br><strong>nightColor</strong> : <i>TypeColorF</i>. Defines night time color when the sun is not shining on the level.<br><br><strong>sunScale</strong> : <i>TypeColorF</i>. The color shading applied to objects in direct sun light.<br><br><strong>ambientScale</strong> : <i>TypeColorF</i>. The color shading applied to objects not in direct sun light, such as in the shadows.<br><br><strong>viewerHeight</strong> : <i>TypeF32</i>. The normalized height (from 0 to 1) of the viewer between the center of the planet and the top of the atmosphere.<br><br><strong>exposure</strong> : <i>TypeF32</i>. Controls the contrast of the sky and sun.<br><br><strong>interpolationStart</strong> : <i>TypeF32</i>. The angle at which interpolation to the night coloration starts.<br><br><strong>interpolationEnd</strong> : <i>TypeF32</i>. The angle at which interpolation to the night coloration ends (fully interpolated).', WIDTH, 400)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyOrbit.jpg" width="193" border="0" height="94" onmouseover="Tip('<strong>azimuth</strong>: <i>TypeF32</i>. The horizontal angle of the sun measured clockwise from the positive Y world axis.<br><br><strong>elevation</strong> : <i>TypeF32</i>. The elevation angle of the sun above or below the horizon.<br><br><strong>moonAzimuth</strong>: <i>TypeF32</i>. The horizontal angle of the moon measured clockwise from the positive Y world axis.<br><br><strong>moonElevation</strong> : <i>TypeF32</i>. The elevation angle of the moon above or below the horizon', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyLighting.jpg" width="193" border="0" height="57" onmouseover="Tip('<strong>castShadows</strong> : <i>TypeBool</i>. Enables/disables shadows cast by objects due to Sun light.<br><br><strong>brightness</strong> : <i>TypeF32</i>. Adjust the global Sun contrast/intensity.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyMisc.jpg" width="193" border="0" height="74" onmouseover="Tip('<strong>flareType</strong>: <i>TypeLightFlareDataPtr</i>. Datablock for the flare and corona produced by the Sun.<br><br><strong>flareScale</strong> : <i>TypeF32</i>. Changes the size and intensity of the flare.<br><br><strong>isRenderEnabled</strong> : <i>TypeBool</i>. Only render if true (and if class is render-enabled, too).', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyObject.jpg" width="193" border="0" height="146" onmouseover="Tip('<strong>nightColor</strong>: <i>TypeColorF</i>. Global ambient coloring of scene during night.<br><br><strong>nightFogColor</strong> : <i>TypeColorF</i>. Color shading of fog present during night scenes.<br><br><strong>moonEnabled</strong> : <i>TypeBool</i>. Toggles rendering of moon image during night.<br><br><strong>moonTexture</strong> : <i>TypeImageFilename</i>. Image used for rendering the moon.<br><br><strong>moonScale</strong> : <i>TypeF32</i>. Determines size of the moon during night scenes.<br><br><strong>moonTint</strong> : <i>TypeColorF</i>. Color shading applied to moon image during night scenes.<br><br><strong>useNightCubemap</strong> : <i>TypeBool</i>. Toggles rendering of star cubemap during night scenes, similar to Sky Box.<br><br><strong>nightCubemap</strong> : <i>TypeCubemapName</i>. Cube map used to render stars in the sky during night scene.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyAdvLight.jpg" width="193" border="0" height="219" onmouseover="Tip('<strong>attenuationRatio</strong>: <i>TypePoint3F</i>. The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.<br><br><strong>shadowType</strong> : <i>TypeEnum</i>. The type of shadow to use on this light.<br><br><strong>cookie</strong> : <i>TypeStringFilename</i>. A custom pattern texture which is projected from the light.<br><br><strong>texSize</strong> : <i>TypeS32</i>. The texture size of the shadow map.<br><br><strong>overDarkFactor</strong> : <i>TypePoint4F</i>. The ESM shadow darkening factor.<br><br><strong>shadowDistance</strong> : <i>TypeF32</i>. The distance from the camera to extend the PSSM shadow.<br><br><strong>shadowSoftness</strong> : <i>TypeF32</i>. Adjusts shadow edge clarity.<br><br><strong>numSplits</strong> : <i>TypeF32</i>. The logrithmic PSSM split distance factor.<br><br><strong>fadeStartDistance</strong> : <i>TypeF32</i>. Start fading shadows out at this distance.  0 equates to  auto calculate this distance.<br><br><strong>lastSplitTerrainOnly</strong> : <i>TypeBool</i>. This toggles only terrain being rendered to the last split of a PSSM shadow map.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkyAdvLightmap.jpg" width="193" border="0" height="75" onmouseover="Tip('<strong>representedInLightmap</strong>: <i>TypeBool</i>. This light is represented in lightmaps (static light, default: false).<br><br><strong>shadowDarkenColor</strong> : <i>TypeColorF</i>. The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if representedInLightmap is false).<br><br><strong>includeLightmappedGeometryInShadow</strong> : <i>TypeBool</i>. This light should render lightmapped geometry during its shadow-map update (ignored if representedInLightmap is false).', WIDTH, 450)" onmouseout="UnTip()" > <br />
              <img src="images/ScatterSkySimBase.jpg" width="193" border="0" height="76" onmouseover="Tip('<strong>canSaveDynamicFields</strong>: <i>typeBool</i>. True if dynamic fields (added at runtime) should be saved, defaults to true.<br><br><strong>internalName</strong> : <i>TypeString</i>. Non-unique name used by child objects of a group.<br><br><strong>parentGroup</strong> : <i>TypeString</i>. Group object belongs to.', WIDTH, 450)" onmouseout="UnTip()" /><br />
              <img src="images/ScatterSkyNamespace.jpg" width="193" border="0" height="74" onmouseover="Tip('<strong>superClass</strong>: <i>TypeString</i>. Links object to script super class (parent) namespace.<br><br><strong>class</strong>: <i>TypeString</i>. Links object to script class namespace.<br><br><strong>className</strong>: <i>TypeString</i>. Legacy version of class field.<br><br>', WIDTH, 450)" onmouseout="UnTip()" ><br />
              <img src="images/ScatterSkyDynamic.jpg" width="193" border="0" height="40" onmouseover="Tip('<strong>(n/a)</strong>: <i>*</i>. No stock dynamic values.', WIDTH, 450)" onmouseout="UnTip()" > <br />
              </p>
            <a name="Modifying_Brightness" id="Modifying_Brightness"></a>
            <h2> <span class="mw-headline">Modifying Brightness</span></h2>
            <p>Remember to refer back to the properties as you proceed through the
              rest of this guide. It is time to modify some of the more
              important fields of the current ScatterSky object. After each change
              is demonstrated, you will be reverting back to the stock values to show
              how these modifications affect the object. </p>
            <p><br />
              Now will start with adjusting the brightness of the sky and
              atmosphere. Under the ScatterSky section of the properties, look for
              the skyBrightness field. The default value is 25. </p>
            <p><br />
              <img alt="Image:DefaultBrightField.jpg" src="images/DefaultBrightField.jpg" border="0" height="57" width="188" /> </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/DefaultBrightScene.jpg" class="livethumbnail"><img src="images/DefaultBrightScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              The skyBrightness field acts a global modifier of your
               brightness in the scene. Changing this value is similar to adjusting the
              contrast of a camera or monitor. Reduce the value to 5. </p>
            <p><br />
              <img alt="Image:5BrightField.jpg" src="images/5BrightField.jpg" border="0" height="55" width="188" /> </p>
            <p><br />
              This reduction will dramatically change the appearance of your level. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/5BrightScene.jpg" class="livethumbnail"><img src="images/5BrightScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              Now, greatly increase the value of skyBrightness to around 85. </p>
            <p><br />
              <img alt="Image:85BrightField.jpg" src="images/85BrightField.jpg" border="0" height="54" width="187" /> </p>
            <p><br />
              The view of your level should be extremely bright, as if the scene takes place in a desert at high noon. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/85BrightScene.jpg" class="livethumbnail"><img src="images/85BrightScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
            If you have not already done so, revert your default brightness back to 25. You should change each value back to the default in this manner between each section of the remaining guide to see the effects of the next property. </p>
            <a name="Modifying_Scattering" id="Modifying_Scattering"></a>
            <h2> <span class="mw-headline">Modifying Scattering</span></h2>
            <p>The scientific concept of scattering and how it affects your level
              is somewhat complex. The rayleighScattering and mieScattering values
              are extremely sensitive, and it is important that you have an
              understanding of how they work. The simplest way to explain scattering
              is to answer a  question children often ask: "Why is the sky blue?" </p>
            <p><br />
              In reality, beyond the  atmosphere of the sky is blank space, that is,  blackness. When you look up at the night sky, you can see the black of space and the stars it contains. However, during the day you see a blue sky. The blue color is due to the light rays from the sun being scattered by the molecules of the atmosphere as it passes through. Light appears to be white but it is actually composed of many different colors. The sky is usually blue because blue light scatters more easily than the other colors due to its physical properties. </p>
            <p><br />
            The sky at the zenith is a darker blue than the sky near the horizon for two reasons. First, the atmosphere at this altitude is composed of much smaller particles, which is only capable of scattering the darker shades of blue light. Second, the light has had less opportunity to be scattered since it has not passed through as much atmosphere yet. The more times the same light is scattered, the paler the blue will become.</p>
            <p><br />
            However, blue is not the only color that is scattered by the atmosphere, it is just the most common. Other colors, such as the reds at sunset, are due to how much atmosphere the light has passed through to get to your eyes. In this case, reds and blues are both being scattered but blue has been dissipated so much that it is no longer visible. The result is a red sky. </p>
            <p><br />The scientific term for this light scattering effect is called Rayleigh Scattering, thus the rayleighScattering property of Torque 3D controls the color and darkness of the ScatterSky object.</p>
            <p><br />
            The size and composition of particles in the atmosphere, such as dust and water, also has an effect on how light appears. Larger particles tend to scatter all colors of light approximately the same. This effect makes clouds, which are made of water vapour, appear to be white or grey. This is because  the colors of the light are being scattered the same so that what you see resembles the original white form.</p>
            <p><br />This type of scattering is also responsible for the clarity of a bright object and how the light rays are projected from it. The scientific term for this type of scattering is Mie Scattering, thus the mieScattering property of Torque 3D controls the clarity of light from bright objects such as the sun. </p>
            <p><br />
              In summary, the scattering properties in Torque 3D are used to emulate the affects of nature. The mieScattering property affects the appearance of how light waves are projected from the sun object and the rayleighScattering property affects the color of the sky including how blue it will be. </p>
            <p><br />
              Proceed to see the adjustment of these properties in
              action. Reduce the mieScattering field to a small value, such as
              0.0005. </p>
            <p><br />
              <img alt="Image:LessMieField.jpg" src="images/LessMieField.jpg" border="0" height="36" width="188" /> </p>
            <p><br />
              You should notice that the scattering of the light around
              the sun object has been drastically reduced, resulting in a smaller and
              smoother sun. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/LessMieScene.jpg" class="livethumbnail"><img src="images/LessMieScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />Reset the mieScattering back to the default value (approximately 0.0045). Lower the rayleighScattering field to 0.0006. </p>
            <p><br />
              <img alt="Image:LessRayleighField.jpg" src="images/LessRayleighField.jpg" border="0" height="35" width="188" /> </p>
            <p><br />
            The atmosphere of the sky should now be a darker shade of blue. Reducing the 
                rayleighScattering value simulates two things. First, it simulates an atmosphere 
                which reduces the colors of light that will be scattered limiting it to the 
                darker blues. Second, it simulates an atmosphere that has had less opportunity 
                to dissipate the light leaving the darker shade of blue intact: </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/LessRayleighScene.jpg" class="livethumbnail"><img src="images/LessRayleighScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              At some point, you can reduce the value only so far before you hit a shade of blue that is almost completely black. This does not mean you are actually seeing the black of space, rather you are seeing the darkest shade of blue light which has not been dissipated at all. </p>
            <p><br />
            Go in the opposite direction. Begin increasing the rayleighScattering until you hit a value of 0.008. This simulates two things. First, it simulates an atmosphere which allows more colors of light to be scattered. Second, it simulates an atmosphere that has had less opportunity to dissipate the light leaving paler shades of the light.</p>
            <p><br />
              <img alt="Image:MoreRayleighField.jpg" src="images/MoreRayleighField.jpg" border="0" height="36" width="188" /> </p>
            <p><br />
              The result in your level is a broader range of colors in your sky. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/MoreRayleighScene.jpg" class="livethumbnail"><img src="images/MoreRayleighScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
            If you go too high with the value, your sky will eventually become black. This is due to the allowance of all wave lengths to interact with the atmosphere. The effect is known as the subtractive rule of colors: white is the complete lack of color (light interaction) and black is the presence of all colors. In other words, the atmosphere is absorbing all colors so you see black.</p>
            <p><br />If you have become confused, there are quite a few resources in your local library and on the Internet you can look up to learn more. If you have gotten this far, but wish to keep it simple, remember the following: </p>
            <ul>
              <li>mieScattering - Higher equals bigger and more scattered Sun. Lower equals smaller, smoother Sun. </li>
              <li>rayleighScattering - Higher equals less blue sky. Too high
                equals black sky. Lower equals more blue sky. Too low equals black sky. </li>
            </ul>
            <a name="Modifying_Colors" id="Modifying_Colors"></a>
            <h2> <span class="mw-headline">Modifying Colors</span></h2>
            <p>Move on to simpler concepts and property adjustments. The
              nightColor is a conditional property, as it only affects the scene
              during certain lighting conditions. As explained in the <a href="Sun.html">Sun</a>
              documentation, modifying the azimuth and elevation will change the
              "time of day" for your level. </p>
            <p><br />Go ahead and set the Elevation property in the Orbit section to 200, which will place the sun below the horizon. When the sun is no longer shining on your level, it is night time. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/200ElevationScene.jpg" class="livethumbnail"><img src="images/200ElevationScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />Scroll to the Night section in the Inspector Pane.  Instead of manually guessing color values, click on the colored box next to the nightColor property. This action will open the Color Picker dialog. The dialog allows you to visually adjust the shade of your night time color. For an intense effect, go with an unnatural color such as red. </p>
            <p><img alt="Image:RedColorPicker.jpg" src="images/RedColorPicker.jpg" border="0" height="347" width="348" /> </p>
            <p><br />
              Click the select button when you are ready. Your level
              should immediately reflect the nightColor change you have made. Very
              creepy... </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/RedScatterSky.jpg" class="livethumbnail"><img src="images/RedScatterSky.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              Definitely change the value back to something more suitable, such as deep blue/black color. Change the Elevation property in the Orbit section back to a number between 0 and 90 such as 45 to bring the sun back above the horizon and relight your scene.</p>
            <a name="Modifying_Shadows_and_Light_Intensity" id="Modifying_Shadows_and_Light_Intensity"></a>
            <h2> <span class="mw-headline">Modifying Shadows and Light Intensity</span></h2>
            <p>There are two fields under the Lighting section that strongly influence how your scene appears. The first property, castShadows, can be toggled on or off. Clicking on the property to toggle it off will result in a blank box. </p>
            <p><img alt="Image:NoShadowsField.jpg" src="images/NoShadowsField.jpg" border="0" height="58" width="188" /> </p>
            <p><br />
              With castShadows disabled, nothing in your scene will cast a shadow: objects, terrain, etc. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/NoShadowsScene.jpg" class="livethumbnail"><img src="images/NoShadowsScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p>You can re-enable the shadows in your scene by clicking the box
              again, which will produce a check mark informing you that it has been
              enabled. </p>
            <p><br />
              <img alt="Image:ShadowsEnabledField.jpg" src="images/ShadowsEnabledField.jpg" border="0" height="58" width="188" /> </p>
            <p><br />
              If you are using Advanced Lighting, the objects in your
              level will immediately begin casting shadows. If you are using Basic
              Lighting, you will need to relight the scene. Either way, the shadows
              will update according to the  position of the sun. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/ShadowsEnabledScene.jpg" class="livethumbnail"><img src="images/ShadowsEnabledScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p>The brightness field under the Lighting section is completely
              separate from the skyBrightness property in the ScatterSky section.
              Unlike skyBrightness, which changes the contrast of your entire scene
              (particularly the sky itself), the brightness property under Lighting
              directly affects your objects in the scene. </p>
            <p><br />
              You can see how this property functions by adjusting the value. Increase the brightness to 1. </p>
            <p><br />
              <img alt="Image:1BrightnessField.jpg" src="images/1BrightnessField.jpg" border="0" height="58" width="188" /> </p>
            <p><br />
              The lighting in your scene should be 
                much brighter.
              Additionally, the shadows in your scene will be much darker and more
              defined. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/1BrightnessScene.jpg" class="livethumbnail"><img src="images/1BrightnessScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />
              
                Notice how your atmosphere (sky and sun) did not change. Every other object in 
                your scene should be better lit. You can
              remove the additional brightness by setting the value of the property
              to 0. </p>
            <p><br />
              <img alt="Image:0BrightnessField.jpg" src="images/0BrightnessField.jpg" border="0" height="58" width="188" /> </p>
            <p>The result is the additional, global brightness factor has been
              completely removed. Your lighting should now be minimal, and your
              shadows nearly invisible. </p>
            <p><br />
              <i>(click to enlarge)</i> </p>
            <a href="images/0BrightnessScene.jpg" class="livethumbnail"><img src="images/0BrightnessScene.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <a name="Conclusion" id="Conclusion"></a>
            <h2> <span class="mw-headline">Conclusion</span></h2>
            <p>In previous guides, you learned how to add an individual <a href="./Sun.html">Sun</a> and
              <a href="./Skybox.html">Skybox</a>. The ScatterSky is a more advanced object intended to simulate
              a nearly complete atmosphere. To fully simulate a realistic atmosphere,
              you can use the ScatterSky object in conjunction with the available cloud layer
              objects. </p>
            <p><br />
              There are two cloud layer objects 
                which you can use: <a href="./BasicCloudLayer.html">Basic</a> and
              <a href="./AdvancedCloudLayer.html">Advanced</a>.</p>
              
              </td>
        </tr>
      </tbody>
    </table>
<script type="text/javascript">

var links = document.getElementsByTagName('a');

for (var i = 0; i < links.length; i++) if (links[i].className == 'livethumbnail') { var img = links[i].getElementsByTagName('img')[0]; img.state = 'small'; img.smallSrc = img.getAttribute('src'); img.smallWidth = parseInt(img.getAttribute('width')); img.smallHeight = parseInt(img.getAttribute('height')); img.largeSrc = links[i].getAttribute('href'); img.largeWidth = parseInt(img.getAttribute('largewidth')); img.largeHeight = parseInt(img.getAttribute('largeheight')); img.ratio = img.smallHeight / img.smallWidth; links[i].onclick = scale; }

function scale() { var img = this.getElementsByTagName('img')[0]; img.src = img.smallSrc;

if (! img.preloaded)
{
	img.preloaded = new Image();
	img.preloaded.src = img.largeSrc;
}

var interval = window.setInterval(scaleStep, 10);
return false;

function scaleStep()
{
	var step = 45;
	var width = parseInt(img.getAttribute('width'));
	var height = parseInt(img.getAttribute('height'));
	
	if (img.state == 'small')
	{
		width += step;
		height += Math.floor(step * img.ratio);
		
		img.setAttribute('width', width);
		img.setAttribute('height', height);
		
		if (width > img.largeWidth - step)
		{
			img.setAttribute('width', img.largeWidth);
			img.setAttribute('height', img.largeHeight);
			img.setAttribute('src', img.largeSrc);
			window.clearInterval(interval);
			img.state = 'large';
		}
	}
	else
	{
		width -= step;
		height -= Math.floor(step * img.ratio);

		img.setAttribute('width', width);
		img.setAttribute('height', height);
		
		if (width < img.smallWidth + step)
		{
			img.setAttribute('width', img.smallWidth);
			img.setAttribute('height', img.smallHeight);
			img.src = img.smallSrc;
			window.clearInterval(interval);
			img.state = 'small';
		}
	}
}			

}

</script>
Clone this wiki locally