Sunteți pe pagina 1din 10

Lighting & shadows

Estimated time : Around 1 hour Attached files : ..\Twinmotion2\Tutorials\Lighting And Shadows\Ressources\

In this tutorial we will explore the dynamic shading system in Twinmotion, and the different types of dynamic lighting in the software. Here are the different steps of this tutorial : 1. 2. 3. 4. 5. The sun The shadows Geographic coordinates system Ponctual lighting Conclusion

Open the lighting_and_shadows_START.TMProj project file, you will find in Twinmotion2\Tutorials\Lighting And Shadows\Ressources\. Twinmotion has a powerful sun + dynamic shadows system enabled as soon as you open the software. This system was designed to ensure you a very high quality render when you load an new project, without having to spend precious time getting the settings right. Howevern to better understand how it all works, we will use for this tutorial a file where the sun and the dynamic shadows has been disabled.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

1. The sun
Go in the toolbar, then in the Effect tab. You can see that the components Sun and Shadows are disabled.

Check the Check Boxes to activate them, then click the Sun icon. The sun tool bar disappears.

Note that even if the shadows are enables, you cannot always see them in your scene. Its because the Cast Shadows amount in the Shadows Quality tab is null. This amount (in meters) is very important because it affects the quality of the shadows as well as the distance where they remain visible. Indeed, Twinmotion uses a Shadow Map system, displaying the shadows in important distances can decrease their overall quality. We will see in details this aspect further in the tutorial. Enter the value 50 m in the Cast Shadow field. You can now see the shadows apprearing in the front of your scene. But the value is too little to display them further in the distance. Change the value to 500 m now, the the shadows are now rendered even in the background.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

Lets take a closer look to the Sun Settings tab, and particularly the Sun Intensitys value. Like most of the features in Twinmotion, the value of the Sun Intensity can be animated in the timeline. This is translated here by a graph on 24 hours where the hours are represented horizontally and the light intensity is represented vertically. Each key defines a light intensity at a given time (T). The software then performs an interpolation between the different keys to create a cycle of the sun animated for the whole day. Place your mouse cursor near the time cursor and right click, then Add Point to add a key point on the graph. When moving this key you will notice that the brightness of the sun changes in realtime. This time right click on the key point itself. This way you can define precisely its value, its position or delete it.

By moving the time slider you will see that the sun evolves in time, according to the values of the curve.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

Twinmotion offers the opportunity to fine tune every setting of the sun over time, it also has a simplified settings mode to set absolute values that will not evolve throughout the day. To do this click on the handle of the slider to collapse the graph. You can now directly modify the value of the intensity. The handle changes its appearance, indicating that the corresponding value is now absolute. You can reset the time mode by clicking the Reset button at the top of the properties panel.

The way the color graphs work is essentially the same, precisely Sun Diffuse Color and World Amb. Color F Right click on a key to change its color and move horizontally to change its location in time.

I The Sun Diffuse Color setting controls the color of the light emitted from the sun, whereas the World Amb. Color controls the indirect light reflected by the World. Now lets take a look at the Specular Intensity options. The advanced material properties of Twinmotion can render materials with realistic specular reflections. The value of Specular Intensity of the Sun can set the strength of the speculars for all materials of the scene.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

Change this value to see the effect on all the surfaces exposed to the direct sunlight.

Go down until the Fill Light tab. Twinmotions lighting system has a second implicit lighting component integrated called : Fill Light. It is used to create a very soft lighting in addition of the sun, to simulate a diffuse lighting on shadowed surfaces. Modifiy its value to see the immediate effects in your scene.

Finally, go down the panel, in the Preset tab. The drop-down Selected Preset menu allows you to use the predefined settings integrated into Sun in Twinmotion. It allows quick access to precise adjustments of the sun according to the different seasons. But it also allows you to save and/or load your own settings for sun to distribute, or reuse them from one scene to another. After trying various options, load the preset lighting_and_shadows.TMSun you will find in the Ressources folder of this tutorial.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

2. The shadows
It is now time to go into detail in Twinmotions shadow system. In the Effect tool bar select the Shadows icon and go to the properties pannel. You will find the specific shadow properties of the sun under the Sun tab. You will find Sun tab settings specific shade the sun. Two important concepts to understand here are the notions of Shadow Maps and Split. A Shadow Map is a texture that stores shading information about the objects that is generated by the real-time engine. The quality of the shadows on the final render depends greatly on the resolution in pixels of the texture. To maximize the render quality of the shadows and overall performance, Twinmotion do not only generate a single Shadow Map, all the shadows of a scene are cut into several successive Shadow Maps. This brings us to the concept of Split. The method of Split in Twinmotion is to divide the total distance of the shadows displayed, defined in the Sun panel, into several Shadow Maps. This system allows defining the distance of each Split and maintaining sharp shadows in the foreground, while maintaining softer shadows in the background. Set the Map Size to 2048 and right click in the Shadow Quality / Nbs of split graph to create a new point like the picture. You can see that the shadows are now much sharper in the foreground, but also on the whole scene.

Understanding the relationship between the Shadow Maps resolution and the distance and number of Splits is essential for obtaining good quality shadows.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

3. Geographic coordinates system


Twinmotion incorporates a full geographical coordinates system that allows you to define the actual location of your project in the world and thus benefit from the exact position of the sun at that place and time. To access this system, open the World Properties panel located under the Time Bar and go to the Geographic Coor tab. Move the cursor over the globe to see the suns position change in real time. You can also enter the GPS coordinates of any spot on the globe or use the dropdown menu of predefined locations. Now that our project has precise geographic coordinates, we will define what date we want to see.

To do this go to the World Time tab and using the calendar place the Current Date on the day of your choice. Again you can see that the suns position changes based on various parameters of the World Properties. Twinmotion allows you to simulate the exact amount of sunshine a building is exposed to, based on the location information and time you give.

However Twinmotion also gives you the opportunity to freely orient the sun at your will or abstractly. To do this go to the North Direction tab and change the Norths value (in degrees).

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

4. Ponctual Lighting
Twinmotion offer three types of ponctual lighting in supplement of the Sun + Fill Light system : Omni : An omnidirectional light whose rays are projected from a single point into all directions. Spot : A light who projects diverging rays in a cone form. Rectangular Area : A light projecting parallel rays from a surface. These three types of lightings are of course completely dynamic and can perform all kinds of possible lighting scenes. To place a light in the scene, go to the Create tab in the toolbar and go down until Entities. Click once on the icon Omni and then click in the scene where you want to insert the source. Twinmotion will automatically search for the nearest surface around the cursor and position over the lamp there.

Once the light is created and selected, you can move itusing the transformation Gizm and edit all the settings in the Properties panel.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

Increase the Range value to enlarge the lights impact zone. Unfold the Intensity graph and place the keys by referring to the image. We are attempting here to animate the light intensity on a whole day. Specifically, we light the lamp when it gets dark and were at zero intensity in daylight. Adjust the color and increase the distance of the Cast Shadow to activate the shadows.

Now return to the Effect tab on the toolbar, then click Shadows. You can see near the suns shadow settings the tabs for other types of lights. Enter Point Light and increase the size of the Shadow Map for better quality.

I Those parameters are common to the whole scene; meaning : each Point Light with activated shadows will generate a Shadow Map of 2048 pixels. A too important quantity of lights or a too big Shadow Map setting can impact highly the display performances.

I The position of the punctual lights is represented in the scene by a transparent sphere. You can hide the display of those spheres using the Display Filters in the Selection And Display panel.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

5. Conclusion
As you can see Twinmotion offers many possibilities in terms of lighting rendering. Its 100% dynamic system allows you to create an infinite amount of quality lighting environments associated with complex shadings powerful animation tools. Twinmotion has been designed to offer the maximum flexibility in the simulation of real time lighting, while maintaining a high level of performance.

Copyright 2010 Twinmotion - All rights reserved - Twinmotion 2.0 Tutorials

10

S-ar putea să vă placă și