July 2018

Monthly Archives

Shadow is as important as light

Shadow is as important as light

When working in lighting and using shadow it is a good idea to understand that all shadow are not the same. Depending on environment, light source and other light sources the shadow is different. You can in our case, digitally, be creative and have shadow tell a story. So did you ever look at a reference image and tried replicating the lighting, but for some reason something was off, maybe the shadows? This should help you to analyze and pick the right solution.

Cast Shadow

Cast Shadow are shadow created when light hits a form, and the form is next to surface that can cast the shadow.

Contact Shadow

This shadow is created is often the blurry shadow right beneath the object itself, it is how you know that an object is in contact with a surface.

Shadow Side

This side represents the darker side of an object. In lighting, all these shadows often receive fake lighting to make it more unique and realistic.


It is important to understand that shadow isn’t black and mostly receives some color or source of light. That is why we will add fill lights to it, to get the desired effect. So even though logically you might place out one light source, you should be doing more than that.

Shadow Size

Understanding shadow size is important as it allows you to understand what type of light, where to put it, which angle and distant to use. The most important thing to keep in mind is the angle of the light source. If the light is coming from above, the shadow is going to be very small. If the light is coming from further down, the shadow stretches out.

Another thing that factors in shadow size is the size of the light itself. A good rule is if the light source is smaller than the object, then the shadow is larger than the object. If the light source is bigger than the object, then the shadow is smaller. The reason for that is because if the light source is bigger, it casts more light and wraps around the object thus reducing the shadow size.

Lastly, the distance of the light will also affect the shadow size. This one however has a secondary thing to keep in mind as shown in the image above with the bear. The distance of the object receiving light and the surface casting the shadow also affects the size of the shadow.


So that is the basic you need to understand when lighting up your scenes in 3DS Max, Maya, Unreal, Unity or whatever really when looking at reference images.

That is it! Be sure to look at my previous blog or stop by my youtube channel.

Cheers

 

 

Lighting Breakdown – The Shield (Unreal)

Lighting Breakdown – The Shield

In this blog post I briefly break down the basics of the lighting for the shield scene, done in Unreal Engine. So, the first thing was putting out the main key light, which in this case was coming from outside of the cave. Similar but dimmer version were added backwards to light up the background using the outside as the source.

Because it is very blue main key light, it is a general good idea to balance it out with some warm. To do that I created fire sources outside of the image and aimed it on the shield, surrounding walls and such to fill in the shadows with warm light. I also used skylight to fill in the shadows everywhere with some colour.

I then added more point lights, and these were baked rather than real time. This was to fill in the cave with a mix of orange and blue, and have it transition more around to avoid harsh transitions.

Because I was using skylight and baking, and the surroundings were not reflecting as intended, I added what I was missing: Reflection Spheres. This created the reflection that would occur in such a wet environment.

Which brings us to the important part of this lighting setup. The fog. It is important to understand that fog is really water particles. And light slows down when it hits dense objects like glass or water, which in return creates refraction, which spreads the light everywhere and makes it diffused. That is the simple explanation. So here is a quick example below. Originally explains how rainbow is made, but the principles are similar for our purpose. The light hits the hovering water particles in a fog, it comes back out somewhere else, and also different colour. In our case we have less white and more blue/orange. And the light we want to turn into fog, is the main key light which is blue. On a side note, that is also why you see that things are somewhere else when in water, because the lights slows down, bends what we see and shows a different position of a fish or a pencil in a glass etc.

Anyway, that is why you see fog a lot in concept art, backgrounds in movies and otherwise as it helps light up the scene evenly in a intelligent way. So you end up with this:

The main reason I created this scene was to understand the fog and volumetric settings better, so this scene will probably receive an update in the future unless I make a new scene to replace this. But as you see, the dark cave now becomes lit due toe the fog picking up the light sources, and spreading out more diffused rather than specifically on the spots.

Below are the settings used to get the look, and it can still get better.

Key light settings

Fog Settings 1

Fog Settings 2

So, hopefully you learned something new.

Summary:

The general idea is to understand that light behaves different in the environments, and keeping the ratio between each light fairly different. Like, the key light is at 4K intensity and 8500 temperature color following Kelvin scale. This means that the other lights are less in intensity and has another color temperature to create the atmosphere, depth, feeling and environment.

We also need to add in extra lights to fill in the shadow, and help build the environment storytelling by leading the eye where we want the viewer to look.

Lastly, I did change the materials roughness/specular level and after this blog post, I changed shadow bias to deal with some of the light bleeding occurring (light reaching places it shouldn’t be).

Make sure to check up my previous blogs:

Compound Lighting Breakdown in Unity

Crunch goes to war Lighting Breakdown in Unreal

Don’t forget the skybox in Unity

Youtube:

And my youtube channel for goodies

Don’t forget the skybox (Lighting/Color)

Don’t forget the skybox

In many projects that I am part of I have noticed that people ignore the skybox, time of day and color of the sun when lighting their scene. More importantly, the skybox do not match any of the choices. So let us just quickly go through why picking the right skybox is important along with the sunlight settings. To understand that we need to look at some reference images and understand how light works.

If we look at the image below, it is brightly lit and you will see most of the colors that nature actually has, this is because the color of the sun is closer to white/yellow at this time, and the dark shadows under the tree shows generally the time of day and position of the sun.

If you look at the next image you will notice that nature has different value (saturation) but in general if the terrain is similar, it has the same colors. However, you might notice that depending on the time of day and sun position, the color yellow-orange pops up more. This effects the saturation, value and tone of the color despite it being somewhat similar in color if both were in the same time of day, sun position and so on.

So what does this mean? Well, to ensure you kind of understand the concept of how environment changes and that the skybox is a big reason for this. Let us turn these into greyscale. Look at them and continue reading after, and only after you notice the subtle difference.

So maybe you noticed that the value/strength of the colors are different even though they are for example green, yellow or blue. This has something to do with saturation and ton of other things, but our focus is to understand and assume that the sky affects the light in such a way, that the value of the color changes depending on the skybox. As the skybox aka sky creates ambience and fills in the environment with the color that is in the sky and of course, time of day. Below are both color swatches put in the same image, with a neutral grey background. Notice how two of the grey are almost gone (red arrows), and if you look hard enough you will notice that every circle overlaps another circle. This tells us that they are different in value. Even the darkest ones on top right, are different.

This is why skybox is important and picking the correct one for the correct time of day is also vitally important. Here are some examples to make sure you understand the difference. For this we are going to use Unity Engine to quickly end this blog post visually.

This is how many people do their light, even after changing the skybox, so what is wrong in this image in terms of skybox and lighting?

1.       The sky is clearly red/orange which means the time of day is either sunrise or sunset.

2.       The light source itself is white, when it should be yellow/orange.

3.       The direction of shadows and shading do not match but do notice the orange glow on the objects, coming from the skybox.

So let us look at the correct version if you light it correctly based on skybox, time of day and sunlight settings.

You can clearly see the brightest spot in the skybox is to the right, you see the time of day, you see the glow on the sphere, you see the shadows and color. Hopefully that gives you some insight on what you keep in mind when you light your next project.

A)      Skybox color, sunlight direction and time of day

B)      Direction of the sun source to create the correct shadows, in both intensity and length.

C)      The correct color depending on time of day, sky box and style.

I hope this was a quick and easy read, and useful. Be sure to read my previous post and stop by my channel at https://www.youtube.com/user/Cyberiusx

Cheers

Amit

 

LIGHTING BREAKDOWN OF CRUNCH ARMY (PARAGON ASSETS)

LIGHTING BREAKDOWN OF CRUNCH ARMY (PARAGON ASSETS)

I made this scene for a competition and I haven’t looked at it for a week or so, as I still think I can improve it and change the way I lit it. It is meant to be a still image, so this one uses Unreal Engine and still image lighting approach which isn’t recommended to use for an actual game. Unlike my previous blog about Game Lighting for Compound Map using Unity, which is fully baked, this one is fully real time. Special thanks go to two people who helped me, they wanted to remain unnamed. So with shared credit, let us get a quick overview of my rather overkill method which I probably update and change after writing this blog.

Step 1 – Gather References

The first thing I do is to gather references as this helps establish the overall art direction, mood, style and approach I will be going for. After a whole day of talking to someone about which reference to use, he finally accepted two choices as good lighting reference.


Now, why are there two lighting reference which are totally different from each other? Well, the blue tone one is mostly for composition, while the red one is for the lighting. As I am limited to what other people provide me, I had to compensate by finding an idea of setting up the scene that might be done using existing animation poses, and generally cinematic lighting. So with the general art direction and inspiration in place I went to Step 2.

Step 2 – Setting up scene and composition

The next thing I did was changing the environment a bit, placing out the models, changing the animation poses, creating variety so their silhouette are clear and unique, look like they are running into war and generally using my reference. You see the blue camera hints on my composition, which is essentially what I use as final image. That means I wouldn’t look at this current angle, to decide if the angle is good or bad, I would look through the camera lenses as this is to be a fixed image.

Step 3 – Lighting up the main Crunch character

As mentioned in my first article Lighting Breakdown of Compound Map, I will turn off all lights, including the hidden default lighting such as bloom, ambient occlusion and so on. So the first thing I did was generally follow three point lighting principles by spending a lot of time, placing spot light around Crunch to figure out how to best light him. Of course, Shawn Booth was a great help during the whole process with vitally important feedback.

Step 4 – Rim Lights for Crunch Main

Rim Lighting Crunch Main Character was up next, and I found that to be the hardest part and I still must tweak it. Because Crunch is metal based, have unique shapes to him and reacts different to light I decided to go overboard to get the general rim lighting I wanted since it isn’t meant to be game based however I do recommend placing those rim lights further up, with wider angle to get the desired effect, rather than doing what I did. But for this purpose, it worked fine.

Now, the reason for the rim lights is to separate him from the background more, otherwise you wouldn’t get the perspective and depth. And the reason for blue color choice, besides the reference is to give a nice contrast of color scheme with warm and cold.

Step 5 – Fill Light for Weapon

As you light you will notice that some areas are not getting the desired effect, and if you understand light you know that light bounces and picks up color as it bounces. You will also know that shadow is hardly ever completely black. So after another round of feedback and fresh eyes, I added some shooting effect, lighting, and fill light to blow the weapon up a bit.

The reason for adding specifically red color to the fill lights, is because the weapon is firing, so naturally the fire and effect around it would give out a highlight inside of the barrel, and around the weapon. I continued adding some fill lights around, to get rid of the darkest shadow but also build the silhouette of the character.

Step 6 – Big Fill lights

I needed more fill light and surrounding areas to light up, this give out of picture reasons to where the lights are coming from so I added lights for front to simulate red light from weapons, guns, fire, explosion and strong led lights from back.

By doing so you would see the terrain lit up, and surrounding characters also starting to pick up some light. Giving the character and rest of the characters a more believable light source.

Step 7 – Transferring the principles

It doesn’t make sense that only the main character who is the focal point, gets all the lighting. So, I added some quick lights to the other character using somewhat the same principles. Although, at this stage I would probably redo the rim lighting all together and tweak the values.

The big guy behind was another challenging character with mixed feedback, some didn’t like the pose, others didn’t like him visible and there at all. Regardless, I decided to fill up the light, so he became visible and I changed his model to be more unique from the rest. Important thing to keep in mind is that I tried to ensure that the rim light (blue) and frontal light (red) came from the same direction, which is why I want to redo those rim lights, as right now I don’t find them to fit naturally enough. I also added walls and lit them up to have brighter background once the fog was added.

Step 8 – Atmosphere

I started added in fog effect, to create the mood and dust feeling. I couldn’t get enough control and depth for the army itself, behind the main Crunch character. So I went and did another step.

Step 9 – Fog sheet

I added another layer of fog using fog sheet, to create more depth and color variant in the air. And eventually was ready to play around with the post effect for the camera.

Step 10 – Post Effects

With color adjustment, tone mapping, ambient occlusion, depth of field, adding particle effects and water effects around water. I eventually called it finished but at this stage I might revisit to make some changes.

Maybe you can learn more if you read my previous blog where I lit up a map for Intruder game. Which is a different process and fully baked. Here

 If you want me to write more and share more, be sure to share this article and heart it on top.

Breakdown of Compound Map for Intruder Game

Lighting Breakdown of Compound Map

To refresh and continue learning about game lighting I helped out Polybius[FSFU] and got help from Culocane (Alessandro Palagano artstation) in the community, in which he lighted his version and I lighted my version. Together we shared our process of working. In this blog post I will be sharing my work process which also indirectly will share some of Culocane methods. Below is what I was given and what I ended up with later.

to this:

Step 1

The first thing when doing lighting is to get reference images so I asked Polybius about what he generally wanted. Although I received a couple, I do recommend looking up several more and discussing with your client what they might be looking for. In this case, I was free to do whatever I wanted so I went ahead with a sunrise/sunset feeling based on what he showed me.


Step 2

I always turn off, delete and remove all kind of lighting that might exist when doing re-lighting work.

So tip #1 – always start with complete darkness.

Step 3

For this particular map I started with the skybox by changing it, the reason for this is because it would affect the overall ambient color and tone of the map. Which in this case would be a bigger deal, and the reason for this is the walls are single sided and made in skethfab. I also changed the tint and setting, to make it more unique after importing it correctly into Unity from HDRI to Cubemap. 

So tip #2 – having a better skybox then default is very important and makes all the difference.

Tip #3 – when you model please use box walls and tip #3 skethfab is in my experience a terrible software to use when it comes to level design and using in Unity. The reason for this is is generally struggles with UV’s.

Step 4

The next thing I did was place the directional light close to where I had rotated the skybox and its sun. And then adjusted the color to be strong tint of orange for the sunrise/sunset which we often refer to as “The Golden Hour”.

The indirect multiplier ensures that the light bounces a bit around, thus lighting up the shadow.

Step 5

I then spent a lot of time figuring out why my light wouldn’t give out proper shadows, and that was because the assets themselves weren’t unwrapped and built for lightmapping. In other words it was missing UV2 Channel for lightmapping. As such, I increased the settings for Lightmapping considerably more than I normally would.

The Indirect Resolution helps increase the quality of indirect lighting, but it also increases the time built. It is recommended to have 2-3 on interior and majority of the map was interior, so that is what I went with. The lightmap resolution was set to 25 which ensures that the details during GI is good enough. Below are checker maps in the Baked Lightmap view, which shows the different between low resolution and then high resolution. The padding was set to 2 but I could have increased it more, the reason for increasing padding is to give more space between lightmaps in the UV Islands, which often fixes blending or bleeding of light on the wrong surface. And finally the lightmap size was increased to 4096 which ensure high amount of detail into the lightmap and bigger size. I did uncheck compressed to deal with gradients issue, but it does come at the expense of lightmap file size.

So, tip #4 – always make sure your 3d assets are uv, unwrapped and has two uv channels. One for your textures and another one for lightmapping.

Step 6

Fixing purchased assets and textures. Often these maps I do have purchased assets, which are out of date in their shader settings. So I had to change their shader to Standard and add emission texture back which ensured that the light had visible emissive source to it. I didn’t like it at the end, so I added a unity cube, put in a new material and made that emissive under the original emissive texture. Below is what it can look like, if you happen to have emissive issues on an asset you bought. Basically, check shader and change it to standard and add emission texture.

Tip #5 – If the shader says legacy shader, try and change and update it so it fits the current version of your engine and technology.

Step 7

I noticed most of the materials didn’t have a specular texture to control the smoothness as much as I wanted. So I spent half a day editing the textures by adding the *.tga files into Photoshop, creating alpha map and editing the new alpha map in Levels. Below are some images to give you an idea.

Tip #6 – Make sure your materials have the needed textures and channels to get more out of lighting.

Step 8

I then started adding, adjusting and tweaking the lighting in one of the rooms. Below is an example where red circled light is fake sky bounce, and blue is fake sun bounce. This is on top of the GI, indirect and reflection that does occur.

Tip #7 – Lighting is very much about faking the environment shape and form, which means understanding how light work is important to know what to add.

Step 9

I did similar approach to the interior lighting, which is basically adding area light to the light source and on the floor. I also played around with spot light to create fake shadow for the light source that would come on the ground. Which at current stage doesn’t fit well, as I added another layer of emissive.

Tip #8 – I don’t recommend this method if using real time light, and keep in mind area lights are super expensive and increases light building A…LOT.

Step 10  & Final Touch Up

When you have the general look and feel, you can go over to post effect and I won’t go much into it. But here is a screenshot of what I ended up with.


Thank you for reading. If you found this useful please leave a comment, let me know and feel free to contact me. Below are some more screenshots from engine. And there is a video at the bottom which shows in-game walkthrough also.

CLICK HERE – Video showing how it looks in-game

CLICK HERE – BREAKDOWN VIDEO FORMAT

%d bloggers like this: