User Tools

Site Tools


public:t-vien-15-3:lab7_more_atmosphere

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
public:t-vien-15-3:lab7_more_atmosphere [2015/10/02 01:36] – created hannespublic:t-vien-15-3:lab7_more_atmosphere [2024/04/29 13:33] (current) – external edit 127.0.0.1
Line 4: Line 4:
 {{:public:t-vien-15-3:lab7-image.png?500|}} {{:public:t-vien-15-3:lab7-image.png?500|}}
  
-<note warning>Uner Construction</note> 
  
 ===== Goal ===== ===== Goal =====
  
-The goal of this lab is to try out and appreciate some very simple but effective techniques for producing a life-like environment. Simple illusions.+The goal of this lab is to try out and appreciate some very simple but effective techniques for producing a more life-like environment. Essentially a few well-placed illusions.
  
 ===== Documentation ===== ===== Documentation =====
  
-  * Unity's [[https://docs.unity3d.com/Documentation/Manual/ParticleSystems.html|Particle Systems]]+  * Unity'[[http://docs.unity3d.com/Manual/GlobalIllumination.html|Lighting Settings]], [[http://docs.unity3d.com/Manual/script-SunShafts.html|Sun Shafts]], [[http://docs.unity3d.com/Manual/script-ScreenSpaceAmbientOcclusion.html|Ambient Occlusion]] and [[https://docs.unity3d.com/Documentation/Manual/ParticleSystems.html|Particle Systems]]
  
 ===== Procedure ===== ===== Procedure =====
  
-  - **Make Room** Start by making a room you can walk around in and use the textures supplied in the zip file aboveAt least use the door texture somewhere, the others are optional. We will be building the effects around the door. Remember to adjust the First Person controller to an appropriate height so that the scale of the door will seem rightKeep the room fairly dim (don't add any light sources other than the **Ambient** light, which you can adjust in **Edit->Render Settings**). If you wish to darken the walls, you can adjust the ''color'' value for the wall materials after applying the textures, by darkening the colorthe overall texture will darken +  - **Make an Environment** Create any enironment you want, but make sure that you have a visible sun in the skyIf your skybox does not contain a circular disk representing the sunyou can turn on the ''Halo'' property of the ''Directional Light'' to make the light source visible in a way that resembles a sun.  Also make sure you have at least one indoor location where a sun can shine through some kind of an opening (e.g. window or cracks). Place and rotate such strucures until you are sure the sun can be seen through some of the openings If you are importing ready-mader objects, make sure they are not using ''Legacy'' shaders, if they are, turn them into ''Standard'' shaders. Import the ''Characters'' asset package and replace the ''Main Camera'' with a ''FPSController''
-  - **Seeing Through Windows** For wall segments that contain windows, you should pick ''Transparent/Diffuse'' as the material shader type so that the transparency value of the texture will get picked up by the shader. This should result in windows you can see throughNOTE: There seems to be bug with these textures (or maybe Unity), the transparency only appears in **Scene** view but not in **Game** view. +  - **Tweak Lighting** Open the **Window->Lighting** panel and play with the ''Ambient'' settings to make the indoor lighting in particular feel more realistic. If the ''Ambient Source'' is the ''skybox'', then the coloring of the indoor walls will match the coloring of the skywhich may not make any senseTry switching to ''Color'' and chosing a tint that better matches the atmosphere you are creating insideAlso lower the ''Ambient Intensity'' to create bigger contrast between the inside and outside lighting, and to make shadows more intenseTo further increase the contrast between lit and unlit areas, you can lower the ''Reflection Intensity'' as well (this is the amount of light received as reflection from other objects)   
-  - **Make Outside Environment** You should put something on the outside of those windowsat least a sky box with a bright and sunny skyAnother possibility is to place a texture of some landscape or city scape on Quad a few meters away (essentially a [[http://en.wikipedia.org/wiki/Matte_painting|matte painting]].  +  - **Add Ambient Occlusion** First notice how the seams where polygons meet the ground and each other at inside corners, seem too evenly lit - you would expect that corners would be slightly darker than the surrounding flat surfacesThose corners should be darker because the surfaces there have access to less ambient light, as they are partially occluded by another surfaceThe effect that is needed is called ambient occlusion, and it can be added as a post-processing step attached to the rendered frame. Import the ''Effects'' asset packageAdd the ''Image Effects->Rendering->Screen Space Ambient Occlusion'' script to your ''FPSController->FirstPersonCharacter'' game objectPlay with its settings and look in particular at the seams where different polygons meetAlso try out the ''Image Effects->Rendering->Screen Space Ambient Obscurance'' script which has more or less the same effect, but may have less side-effects (such as odd shadows in the leaves of trees).  
-  - **Add Sun Shafts** Strong light coming through windows may illuminate particles in the air and create visible shafts of light. Instead of modeling volumetric lighting (i.e. the actual interaction of light with particles)we can fake these shafts with a few well placed texturesCreate a **quad** and place it perpendicular to the quad representing the door wall segmentApply the **beams** texture to this quad and ensure that transparency is used by the materialAdjust the placement so that it looks like the beams are coming from the broken windows. Duplicate this quad a few times and spread them across the windowTo make them visible from more angles (they are of course very thin!you can rotate some of them a little bit and even flip some completely+  - **Add Sun Shaft** Add the ''Image Effect->Rendering->Sun Shafts'' script to your ''FPSController->FirstPersonCharacter'' game object. Drag your ''Directional Light'' into its ''Shafts caster'' propertyDrag the ''Directional Light'' higher up into the sky, in the direction of the Sun in the skybox (you can turn on the ''Halo'' property of the ''Directional Light'' to see the light as a glowing diskwhich you can line up with the skybox sun, so that the light will seem to come from that direction (try moving around the environment to check if the halo disk stops covering the skybox sun when you change your locationYou will find that you really need to place the directional light super-super-far-away for it to remain more or less stationary in the sky because of the motion parallax effect). Move to a location in the scene where the sun is barely visible (e.g. through a window). Play with the Sun Shaft parameters  
-  - **Add Light Projector** Make sure you have imported the **Projectors** package from the **Assets** menu. Find and add the **Blob Light Projector** game object to your projectPlace the projector outside of the door such that the light from it will fall on the floor on the inside. Now you have to create a light texture that mimics the pattern of the broken window. In any paint program such as Photoshop or [[http://www.gimp.org/|Gimp (free)]]use the door texture to create another texture of the same size (1024x1024) but completely transparent aside from white areas where the broken windows are located. There are many ways to accomplish this. One way is to open the door texture and use a selection tool (e.g. flood select) to select only the broken window partsThen create a new 1024x1024 texture with a transparent background and use the selection to fill with white exactly the same broken window area. In Unity, create a new material with shader type **Projector/Light** and assign the new texture to it. Also, in the texture properties (select the texture itself, not the materialset ''Wrap Mode'' to ''Clamp'' to prevent it from being repeated many times across the floor. Finally adjust (e.g. fiddle with placement and the ''field of view'') until it looks right.  +  - **Add Particle Effect** Add an effect that emulates dust particles visible inside the rays of sun that penetrate your indoor environment. Right above your **Hierarchy** panel select **Particle System** from the **Create** drop-down menu. It should already be producing shiny little particles. Place the system right where beams of light hit the floor of your indoor environment and rotate it so that the particles travel in the direction of the beams towards the opening where the light shines through. Look at the parameters you can adjust in the **Inspector** panel for the particle system. You need to make these particles imitate very small dust moving very slowly through the air. You can play with the following adjustments:
-  - **Add Particles** Right above your **Hierarchy** panel select **Particle System** from the **Create** drop-down menu. It should already be producing shiny little particles. Place the system right where the beams of light hit the floor and rotate it so that the particles travel in the direction of the beams towards the window. Look at the parameters you can adjust in the **Inspector** panel for the particle system. You need to make these particles imitate very small dust moving very slowly through the air. You can play with the following adjustments:+
     * In the **Shape** module: Select the ''Box'' emitter shape. This will shoot the particles in one direction (which you can control by rotating the box).     * In the **Shape** module: Select the ''Box'' emitter shape. This will shoot the particles in one direction (which you can control by rotating the box).
     * In the **Emission** module: Slow down the rate of particle generation until you just get a few per second (e.g. 3 per second or so).     * In the **Emission** module: Slow down the rate of particle generation until you just get a few per second (e.g. 3 per second or so).
     * In the **Particle System** general parameter module: Play with ''Start Speed'' and ''Start Size''. Make them really really small! If you press the down arrow next to a parameter value, you can choose from some dynamic options instead of just using a constant value. For example, try making the speed random.     * In the **Particle System** general parameter module: Play with ''Start Speed'' and ''Start Size''. Make them really really small! If you press the down arrow next to a parameter value, you can choose from some dynamic options instead of just using a constant value. For example, try making the speed random.
     * In the **Color over Lifetime** module (you have to first add a check mark to include this module): Click on the color bar to open the [[https://docs.unity3d.com/Documentation/Manual/GradientEditor.html|Gradient Editor]]. Make the particles fade in from full transparency to full opacity and then again back to full transparency. To do this you need to add one new **Alpha** marker in the middle, which you set to full opacity (Alpha 255), while setting the other two **Alpha** markers to full transparency (Alpha 0).     * In the **Color over Lifetime** module (you have to first add a check mark to include this module): Click on the color bar to open the [[https://docs.unity3d.com/Documentation/Manual/GradientEditor.html|Gradient Editor]]. Make the particles fade in from full transparency to full opacity and then again back to full transparency. To do this you need to add one new **Alpha** marker in the middle, which you set to full opacity (Alpha 255), while setting the other two **Alpha** markers to full transparency (Alpha 0).
-  +
/var/www/cadia.ru.is/wiki/data/attic/public/t-vien-15-3/lab7_more_atmosphere.1443749811.txt.gz · Last modified: 2024/04/29 13:33 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki