Command of the Week - Global Sun (Week 51)
This series is called the command of the week, but it could also explain a feature. The explanations will tend to explain the technical parts of the command, and is intended to highlight the basics (and complexities) of the command, and information about how to use it, but won't be a detailed tutorial. It is up to you to use it creatively in your maps.
Week 51 - Global SunIn CC3+, the global sun is used to indicate the direction and strength of light in your map. This light is used in several effects and features, most notably shaded polygon (used for roofs in CD3 and shapes in Per3 and more), lighted bevels, directional wall shadows, and with the point light shadows (used for dungeon/floorplan lighting).
Many of the aforementioned effects can also be set to ignore the global sun and set up their own direction, but by relying on the global sun instead, you have a single place to change the value, and all effects relying on it will behave properly, ensuring that you don't have some effects that makes the light come from the north, while others make it looks like it comes from the south, for example shadows going in opposite directions.
Where to find itToolbar: Right click [Image_9979] -> Global Sun
Command Line: SUNINFO
How to use it?Using this command is a two part-procedure. You need to both set the global sun values in the dialog that shows when you run the command, as well as define effects in the map that will actually use these settings in this dialog. The values you set in the dialog is meaningless if no effects are set to rely on them, you cannot directly change light level in the map from this command, it is only a way to control other effects, as well as shading (see the Shaded Polygon command).
When running the command, you will see The Sun dialog pop up. This dialog contains many settings, and you should be aware that not all effects use all the settings here. Some (like wall shadows) are only concerned about the compass direction (azimuth) the light is coming from), while others (like shaded polygons) also care about the strength of the sun and the height above the horizon (inclination), and uses this information along with the pitch and direction of the shaded polygon to calculate the final light levels.
[Image_9980]Let us examine the values in the dialog, and what they are used for.
- Azimuth: This is the direction of the sun in the sky. There are two things to be aware of here. Firstly, remember that lights comes FROM the sun, so if the sun is due north, shadows will point due south. Secondly, remember that this is based on the CC3+ coordinate system, which means that a value of 0 means due east, 90 means north, 180 means west, 270 is south and 360 is full circle, so back to the east. So while we still use 360 degrees here, these will NOT match compass values. Note that the sun is considered to be an infinite distance away, making all shadows parallel (The real sun is far enough away that this is a reasonable assumtion)
This value is used by most light and shading effects.
- Inclination: This is the height of the sun above the horizon. A value of 0 means that it is at the horizon, while a value of 90 means it is straight overhead. This value is used along with the pitch of shaded polygons to determine how they are lighted. The higher the sun is in the sky, the less difference there will be between polygons facing the sun and those facing away from it.
- Intensity: This controls the strength of the light output from the sun. This is used by shaded polygons to control how much the light affects them.
- Activate Lighting: This enables/disables the dynamic floorplan lighting system. This requires that you have already set up both point light effects and actual light sources in your map.
- Shadow - Blur: This controls the blurring of shadow edges from the dynamic lighting system
- Shadow - Transparency: This controls the transparency of point light shadows. This is very helpful if you wish to show off the whole map, even the parts in darkness. A value of 0 means no transparency, which means anywhere on the map not lighted by a light source will be completely black, while a transparency of 100 means full transparency, so shadows aren't visible at all. Try with a value of 25 to make the parts of the map not lighted quite dark, but still visible.
- Disable shading: This disables shading of shaded polygons. This is useful if you are only interested in using it to rotate fill styles to match the orientation of the polygon, but are not interested int he shading effects. Of course, this applies to every shaded polygon in the entire map.
- Disable aligned fillstyles: This will draw all shaded polygons without rotating the fill styles to match their orientation. This is useful if you only want the shading, but not the rotation of fill styles. This will speed up map redraws.
- Draw aligned fill styles as solid: This draws solidly filled fillstyles insted of aligned bitmaps on shaded polygons. This will speed up map redraws
ExamplesThe below image shows what happens to shading and shadows as you move the global sun around.
The example below shows a simple dungeon with point light effects set up, a single lightsource in the middle of the room. The left image shows the map with a shadow transparency of 0, while the right one use a value of 33. The right image is still dark, but you should still be able to make out the details of the map where the left image was completely black.