3D Artist: Francesco Furneri
Making Of: Crocodile Project, Lighting & Rendering (second part)
Software: Maya,  Zbrush, Substance Painter, Arnold and Marmoset Toolbag

Project Link: https://www.artstation.com/artwork/oA006W

Welcome back to the second and last part of this article about the Crocodile project.

Just a quick reminder for our new readers. The first part involving the texturing process can be found at this link:

https://www.treddi.com/cms/making-of/crocodile-project-texturing-prima-parte/4927/

As we said, in the first part, we talked about the workflow for texture creation in Substance Painter.
In this new article, we'll be discussing about lighting and rendering in depth: I will then give you some tips and some useful advice to plan your work and to comprehend some key concepts while rendering a 3D scene.

To those of you who don't know me, my name is Francesco Furneri and I'm a 3D artist with more than 10 years experience in 3D Computer Graphics and specialized in 3D Modeling and Texturing.

I have worked in 3D companies as modeler, sometimes with the role of technical artist and I am dealing with texturing at the company I currently work with.
At the same time, I have an activity as freelancer in the States, creating 3D organic modeling for characters and props texturing.

I want to thank treddi.com for giving me the possibility to share this article with you and I really hope that you find this description useful for your ongoing projects.

Introduction - The sampling


Lighting, as well as rendering, are considered one of the latest steps during the creation of a 3D scene and they are related to each other: that means, for instance, that the presence of some light sources and their setting impact on the render times.
Also, for example, the presence of an environment map (an HDR texture used as an ambient light) must be considered for the render times too.

Talking about rendering ,the sampling is one of the most important concept that you should be aware of from the very beginning: we try now to understand what that means in terms of rendering a 3D scene.

I'll try to introduce some general concepts and then I'll go through Arnold for Maya to finish with my specific project.
What I'm about to explain now is not related to a specific 3D package and there are some parts where I refer to the specific renderer.

Arnold  is a photorealistic render engine based on Path tracing, that is very powerful and accurate algorithm to calculate the global illumination in a scene. it is related to the Ray tracing that shares some aspects with.
In the Ray Tracing, the lighting is calculated by considering a series of View Rays starting from the Camera towards the scene: when a ray hits an object can be reflected, refracted and a Shadow Ray  is traced from a point to the Light Sources to test if that point is in shadow or not: if the point sees the light, then a shading algorithm is used to determine the color of that point.
The process of reflection / refraction stops after a well defined number of light bounces due to the algorithm.

In the first example below, there are no reflected or refracted rays but just 2 points that see the light source and 1 point which is in shadow.

The grid (Image) can be thought as our screen where  the calculated value of the points is projected back: for the first 2 points that see the light, the shading algorithm is performed and their value is sent back to the grid; the point 3, instead, is in shadow and the shadow value is also sent back.


6d530bb675ca56129a1b494d4f494107.jpg

By starting from the camera, instead of tracing rays from the light Sources, speeds the process up and cuts the rays that we don't see from the camera (for instance behind the sphere, as long as the sphere is 100% opaque).
For simplicity's sake, we have just considered the direct illumination without light bounces but, in reality, we should follow the light rays reflecting off of a surface or, if the material is semi transparent, passing  through by refraction: if we stop at direct illumination, we are talking about Ray Casting, whereas if we calculate the light bounces  we are talking about Ray tracing and Global Illumination.

But what's the point of that?

Just to let you know that the number of camera rays (view rays) determines a number of sample: in simple terms, the more resolution the grid, the more the rays and samples are considered in the scene; that means more quality and less aliasing but the renderer takes more time to render.

See now a more interesting example of Recursive Ray tracing dealing with more light bounces.


cdaaa830575a96706f7ec3059b607c3d.jpg

As you can see, the point on the image plane is the result of the direct illumination from the light source plus the contribution of reflected and refracted rays that bounce off of the point that is hit by the primary ray. There are obviously shadow rays in the scene.
The samples determined by the view rays on the grid are called Camera Samples because they start from the camera: those are the most important samples (also useful for the anti aliasing calculation ) but in rendering, there are also other types of samples.

We introduce now the Path tracing in Arnold.
The algorithm uses the same principle as the Ray tracing but it introduces more accuracy dealing with the diffuse interreflection between surfaces and not just the specular reflection as the Ray tracing does.
Let's wrap it up with a visual description from the Arnold guide.

Let's say that we have a light source coming from up left that projects a shadow of the sphere on the floor. Eventually, there is also a 360° sky light.
From the points where the camera rays hits the sphere, a series of other rays are created: they are called indirect diffuse rays and they are responsable for the interreflection between surfaces.
In particular, for each sample on the sphere, there are n rays that look around to gather the lighting and color information from other surfaces for the particular sample. At the end, a sample on the sphere, has a color that is the contribution of all its indirect diffuse rays.

In Arnold, those indirect diffuse rays are simply called Diffuse Samples.

91310b190c389166ae13a9104145d69f.png

We want to calculate the lighting on the sphere, based on the surrounding area.

Let's imagine the sphere being surrounded by many objects, some of which have different and  saturated colors.
We then trace rays from the camera towards the sphere and for each point(sample) on the sphere we trace indirect diffuse rays.
Those indirect rays are generated according to Montecarlo algorithms thus they are random.
Those indirect rays gather lighting information and return that to the current point (sample) that is seen on the screen.

So , for example, from a point on the sphere (called A), we create some indirect diffuse rays: some of them gather info from a red object,  some gather info from a blue object and again, some other green info from a green object: the returned value to A is determined by the contribution of those colors.
Now, let's consider another point nearby (called B), and we trace some indirect diffuse rays: if we use few rays and because they are random, they might gather more red than blue and return a color that is visibly a bit different from A.

If adjacent values are not uniform we might encounter a problem called sample noise, that is due to low sampling: the final aspect of that region is the presence of grain. We don't want that!
In order to avoid that noise we have to increase the number of Diffuse Sample rays for each point on the sphere. That way, we have more uniform ligthing distribution as we gather more info from a point.

In the Arnold interface there is a parameter called Diffuse Sample that manage the number of sample per point.

Let's have a close look at the Sampling interface.

In the following setting, the value of 3 for the Camera (AA) means that every pixel is subdivided into 9 subpixel (3^2) that are our 9 camera rays directed towards the scene.
Diffuse 2 means that for each intersection of camera rays with the geometry, we have 4 indirect diffuse rays (2^2), for a total of 36 rays per pixel (9 x 4) 

As we can see, the algorithm is applied to subpixels, that are our Camera samples, while the final color is calculated for the single pixel  with anti aliasing techniques and filters.

It's wrong to compare a sample to a pixel, because a pixel is usually made of n sample. The reason is because we want to have cleaner renders without visible aliasing effect.

4534ab9d3e4d5c28972925e7d2bb708d.jpg

I'll quit talking about sampling now and I hope that my explanation is useful when you need to set up a scene.
The other parameters like Specular, Transmission, SSS, etc.. follow the same logic as explained, but they depend on different rays like reflection, transmission, subsurface scattering, etc..
Also lights have light samples which improve the aspect of direct specular reflections and the soft shadow quality.
In the interface above, the total number of samples doesn't include the light samples - Total (no lights).

For a complete understanding I'll give you the direct link to Arnold sampling: https://docs.arnoldrenderer.com/display/A5AFMUG/Samples

A few notes:

  • More samples means more quality but also longer render times;
  • the settings depends on the type of scene and materials that you are going to produce: if you have few reflective objects, that are also positioned away from the camera, you can easily avoid increasing the option called Specular. Also, if you don't have any translucent material, you can ignore the parameter called SSS;
  • Arnold has a very interesting option called Adaptive Sampling by reducing or increasing the number of camera rays based on a threshold: low threshold values mean more sensitivity to noise, thus more samples per pixel;
  • In order to set the number of light bounces, use the Ray Depth rollout: the default setting is quite good for almost all the situations. In case you need to render an indoor scene with many details, the advice is to increase the number of diffuse, specular and transmission bounces. That strongly improve the final quality;

8b1fd86041f01d0ed706e9ae377db672.jpg

  • In the latest version of Maya, you can also take advantage of the new Arnold GPU renderer. There is just the camera (AA) option enabled and everything is easier to use: the suggestion is to use the adaptive sampling too, with the setting reported in the official Arnold guide.


How to create the right mood


Before using the lights in a 3D scene, I always think about the kind of result and mood I want to obtain: the atmosphere is quite important to communicate a sort of feeling.
It's not always easy to have a clear idea of the final results from the very beginning but there exists some common lighting schemes that come in handy for us.

For instance, there is a scheme called 1 point lighting, where the presence of a single key light on a subject, from a specific angle, makes the sense more dramatic.
On the other side, there is another scheme called 3 point lighting where we always have the key light, a fill light to balance the darker areas and a rim light which makes the edges of character pop up from a background. The previous lighting schemes can be applied in different  situations and they are usually found in portraits or for characters.

There is also another type of lighting (Naturalistic Lighting) where the mood is determined by the nature (e.g. sky light) and the result can be improved by adding supporting light sources to create more contrast in certain areas or to communicate drama, to capture the attention of the viewer and so on.
Then, there is freedom and not strict rules: it's always a good habit to start from simple lighting schemes and to improve incrementally the result. The goal is not just following schemes but communicating your feelings.

For instance, If I was asked to render a knight, concentrating on the armour details but without a proper 3D environment, I would probably decide to apply a 360 HDR Image first (to give more interest on the metal armour).
From that point on, I would probably refine the result by playing with specular reflections (introducing fake lights too) in areas where I'd rather show wear surfaces or where the roughness is worth seeing.
I would probably add directional lights too if I desire to have a strong light (key light) coming from a specific angle.
That is just a simple example to give you an idea about starting from a fill light (ambient) and progressively add sources to enhance details.

An example of lighting that I like to mention belongs to another project that I did.

Here we can see a clear presence of a key light (coming from the top right), in order to create contrast with the rest of the scene, which is lit by a soft environment map. In this particular case, I started from a 360 HDR and then I decided to add the direction light (key light) and some post effects like volumetric lighting and fog presence at the lower part of the render.
The goal was to suggest something fantasy with a more of medieval look. I only had the 3D model and not the 3D enviroment.


029c6ca9cbd2f7535b6b2dc3b99e9c50.jpg

In this render below, I kept the same ambient lighting with the same environment map but I added another light at the right to show the stone material details and a light from behind (cooler in terms of color), showing the circular structure of the well and creating a nice transition of color in the basement: from a warm to a cool hue and viceversa.
This lighting scheme has a front light, a fill light (environment) and a back light that can be considered a sort of rim light.

You can see more renders at my Artstation page: https://www.artstation.com/artwork/b8wYn

0c4a5c5023c3a1ac828570108236109b.jpg


Crocodile Project - Lighting schemes


In this paragraph we finally talk about the crocodile project.

The first render below follows a scheme called white box lighting.
It has 3 lights from 3 different directions: one from the left, one from the right and the other one from the top towards the character.
The purpose is to show the subject from all the directions. it is commonly used to present a product, to showcase your character, to create a 360 turntable where all the details are important. There is no reason to add drama or high contrast in this scheme.
Naturally, the only dark areas are in the occluded parts of the model like in the legs and inside the mouth.
In a real studio, this lighting scheme can be achieved by using soft boxes which create soft shadows. However, in the software,  the same result can be obtained by using area lights.


ebf7049823451ea46f3051e570d8940e.jpg

The render has been made with Arnold and, about the sampling, it was essental to increase the diffuse samples from the program interface. As we said, that avoids the presence of noise, expecially in areas where there is no direct lighting.

I used this scheme to show a turntable version of my crocodile: at the following page you can find a quick animation

https://www.artstation.com/artwork/oA006W

Another lighting scheme was produced by using Marmoset Toolbag.
It's a tool for lighting, lookdev and GPU rendering of 3D models and it's also an excellent tool for creating an interactive experience for the users that can move around your subject interactively.

67d27c2bf05c8651db7184b1e4c61822.jpg

The first thing that we notice, compared to the white box lighting, is the different mood.
Here I wanted to create more drama and to emphasize the inner part of the mouth.
With this idea in mind, I added a spot light on the left side of the crocodile, where I wanted to focus the attention on the specular reflections of the scales because it was interesting to have it.
I then added another light behind the subject to create a silhouette of the head: the black background cuts the edge of the crocodile'head.
By hiding the rest of the render, just that rim light makes the crocodile shape recognizable.
Finally I experimented a direct light towards the lower part of the mouth to increase the contrast and to create a nice and soft indirect bounce onto the upper part (the palate): the light distribution is interesting there!

ec1c6add25c74b9dd14cdce2a42c6887.jpg

The light directed towards the inner mouth is the key light, while the one creating the silhouette is the rim light and finally, the one on the right side of the screen is a sort of fill light.

This is essentially a 3 point lighting scheme without the use of any environment map.

With Marmoset Toolbag, you have a bunch of interesting features involving the Camera and the final render.
Generally, when I create a close shot like the next one, I like adding a depth of field option:  in the previous image you see that part of the crocodile's back is intentionally out of focus.
The depth of field improves the shot, as well as the use of small grains in the image. In fact, I added some noise that is almost unnoticeable here (at my Artstation account you can appreciate that better).
The presence of noise is related to the old cameras, where an high film speed corresponds to more grain or, if we talk about modern digital cameras, the more the ISOs, the more the digital noise. 

Marmoset also provides the users with some cool Post Effects like luminosity, contrast, saturation, etc..


564464750cb7c40aa001a946dc187bf8.jpg

Furthmore, it also has the possibility to make sharpen edges in the render (Sharpen) or to apply a Bloom or Vignette effect, or as we said, to add grain.
If you are interesting and you want to learn more about Marmoset, here is the official website: https://marmoset.co/toolbag/

Let's get back to our renders by introducing a more interesting close up now.

ae24d9af90e6f1869cd5f69cd2785233.jpg

Again, the idea is to capture some details and, particularly, the upper part suggests a bit of drama for the presence of the intimidating eye and for the type of framing.
The render is made inside of Marmoset Toolbag and here are some interesting details:

  • the light shows the albedo on the side in a soft and uniform way, without exaggerating the light intensity
  • the presence of interesting specular reflections improve th erender quality and their distribution on the top part of the head draws the viewer's attention
  • a shallow depth of field, for shot like that, suggests the use of a tele lens, where the eye area is on focus and the rest is not
  • the presence of out of focus background, created with a simple image plane, makes the integration better because we know that the crocodile is living in an environment
  • the use of chromatic aberration, that affects the type of lens (behaving like a prism) and where different wavelengths bend at different angles without focusing on the same point of the focal plane.
    The effect is noticeable on the teeth with the presence of a subtle red fringe 
  • The add of small grain effect as we explained for the previous render

It's also interesting to notice the presence of a LUT(look up table) that changes the colors a bit by burning some dark details and by creating more drama in the scene: for instance, on the membrane near the jaw, on the right on the scales and a bit on the left.
Finally, to create more realism, I decided to add a lens dirt effect (e.g. some small stains on the lens). It happens when a lens is not properly cleaned up: the effect can be seen on the background image,  with an hexagon shape and some small stains here and there.

Most of them are post processing effects and they should be used to improve some aspects of your render. Don't overuse them if not necessary!

Before talking about the last render, I'm going to show you some quick examples of dramatic lighting that you can achieve with the previous LUT.

See how we want to draw the viewer's attention on the scale details, with specular reflections on the left side of the crocodile; the entire composition is affected by the LUT which burns the darker parts. Some details vanish on purpose: it's obviously a style that I wanted to experiment and it's similar to the style choice that I saw in the game called "the evil within", where the artists intentionally want to add an horror style.

See on the bottom, on the side of the tail: there are no details there: it's not physically correct but it gives an interesting mood after all.

dfea5400538950f2a2a6051a05f77b7b.jpg

In this scene below I applied the same light setting: a light from the top left to emphasize the details and the specular reflections, the same LUT as before, to burn dark areas and a light coming from the right side (warmer) to give more interest, as if there was an artificial light source off screen.
This lighting scheme is set to give solid details on the crocodile's back and to create an interesting shadow on the front paw. Globally, the right part of the scene is lit by a warm color whilte the left part is lit by a cold color: the contrast reinforces the composition.

Notice that the crocodile's head, despite being burnt by the LUT, preserves some details on the side due to the presence of the warm light.

In all my examples, we have always started from a precise idea and purpose: we've applied traditional lighting schemes but also, we've refined those schemes or applied  custom solutions in order to reach a certain mood and atmosphere.

38204339e7ddd902b1cbd8ebc141d324.jpg

As last example, before coming to the conclusions, let's consider how we can integrate our crocodile into an underwater environment.

d5e5503298b6f446abc1d1321e4d31cd.jpg

Apart from talking about light settings here, I would like explain how I put the crocodile render onto a real backdrop.
In this example I downloaded a real image from the web to test a different mood.

I admit that, because of my personal taste, I prefered to choose an image with more limpid water rather than a dirty place (I also wanted my crocodile to be more visible). Though, It might be curious to try another environment with a swampy look, so that the scattering effect underwater appears interesting. I let you try to think about that!

Let's now get back to our integration.

First of all, this is my rendered crocodile in Arnold with an uniform light setting and without too much contrast.

9151ac6cee1ec50b521909bcfef5dd67.jpg

From our first impression, the crocodile doesn't seem to match the environment lighting at all!

The colors are not managed as well as the tones seem literally off. The render needs some color correction as we want the crocodile to appear in the water

To work and edit the rendered image I worked in Photoshop.

The image below is COMPLETELY WRONG and the crocodile doesn't seem to blend correctly.

17dce03529d104b87223b81ddacd8394.jpg

There are many ways to make the colors match between images. The first tool that I tried is called Match Color which works on the 2 images together to reach a decent color match.
Unfortunately, my first try didn't succeed because the tool is powerful but can introduce some color cast that is obviously not desired. As you can notice from the image below, the light blue from the sea blends with the crocodile's skin causing a kind of green in the render: the animal is into the water after all but the water itself cannot affect the color so much. Another solution had to be applied.

This is the first try I talked about:

b7123e391a1e9c1a6da6f79eaebc9bf7.jpg

It's better but the match is still wrong for the reason we explained before: the color cast introduces light blue / green colors but we want to preserve the dark color on the back and, at the same time, to make the water slightly change it.

If not satisfied with the Match Color tool, sometimes I use a filter calculating the average hue in an image. After having the average color in a separate layer I put it on top of the crocodile and I'm free to use blending modes to obtain a more realistic result.
The functionality I'm talking about is under Filter->Blur->Average.
That is not just used alone but I create a stack of adjustment layers, curves, levels to reach a better integration.
In some cases I use the Color Lookup and I experiment different LUTs.

At the end you can see that the crocodile is in the water but there is no an evident color cast on the skin.

To add even more realism I applied some blur to the crocodile layer (to smooth the sharp edges a bit) thenI added the depth of field that makes the tail a bit blurred with the background.

I also created some adjustment layers to the entire image where I wanted the left side to be brighter than the right side: there is a sort of gradient from left to right. Small touches but with the idea in mind to increase the depth in the composition.

Just to talk about the environment itself: before putting the crocodile in Photoshop, I also worked on the downloaded image a bit, because the original photo was too uniform and blue.
I applied some color correction and layers to add more variety and turbidity: you can notice some small differences on the stones.

7b888daf5c0b5d7bb98a3233bfbddb7c.jpg

Again, this is the final result: the crocodile seems to live in the environment thanks to Arnold and Photoshop. 

aec44d682f7feca720355a713ffc8e2b.jpg


Conclusion


This brings up to the conclusion of this article about lighting and rendering.

I hope that you liked my work, where we introduced the term Sampling, that is a very important concept while setting up  a 3D scene for rendering: every 3D software (Maya, Max, Blender, Cinema4D, etc..) deals with the sampling.
My goal was to give you a quick introduction to understand how to obtain clear renders by just setting the camera AA and the diffuse samples in Arnold. 

We then moved to talk about the mood and the atmosphere in a 3D render: we introduced different basic lighting schemes and we explained the motivations to insert a light in a place rather than in another one.

After that, we described the crocodile project with some examples.

Finally, I introduced a short example of post production in Photoshop as a way to integrate a 3D model into a real image.

I leave you now with some bits of advice.

Final bits of advice


  • Deepen the Sampling concept with not just the camera AA and diffuse sample parameter but try to understand the other type of rays (specular, transmission, SSS, etc..) and how to set them according to your scene;
  • Study your 3D scene to have a thorough understanding over the use of the Ray Depth 
  • Learn from the references to understand the mood: even many artists from the past use interesting lighting schemes (for instance Rembrandt for his portraits);
  • Don't stop at simple lighting schemes: remember that those are starting points that can be modified, enhanced and enriched with your own lighting. 
  • Get used to Environment Maps like 360 HDR for instance, because sometimes they can be useful to introduce ambient light and interesting reflections on your objects
  • If you have time, try to experiment more renderers to understand the differences (e.g. Arnold, Marmoset, VRay, Redshift to name a few);
  • The post processing can be helpful to improve the quality of your renders: if you already have a good quality render in your 3D package, you are already on the right track;
  • To integrate your 3D model onto a real background follow my simple advice and learn more on guides and online tutoials. It's not hard to get used but it requires time and patience.

I hope that my final bits of advice can be helpful and that you can develop some good projects.
I recommend to read the first part of this article involving the texturing at the following address:

https://www.treddi.com/en/cms/making-of/crocodile-project-texturing-first-part/4931/

Furthermore, if you want to use my 3D rig for your projects, here is the link where you can buy it:

https://www.turbosquid.com/3d-models/crocodile-rig-animations-3d-model-1642779

For any question, feel free to contact me at jackfurneri1984@gmail.com


All the best in your work!!!