Free 3d tutorials: from 3d tips & tricks to advanced 3D software tutorials in 4 seconds.

Gradient tutorial

“Gradient tutorial” by Gerardo Estrada
Several people have asked me about the technique to make in LW this image created originally by Twilight in VRay. The render time at 640 x 480 are 7min 46 seg and at 800 x 600 are 9min 42 seg (P IV 2Ghz) recommendation:

To maximise the realism of your 3D rendering we recommend to use high quality photo textures from the #1 texture website
The GI effect in this scene is achieved mainly with gradients based on distance of Null objects:

To explain it better I’ve prepared a simple scene:

The room shown above, don’t have any light (Light intensity = 0 / Ambient Intensity = 0), only 4 Nulls to adjust the bouncelight effect of basic ambient light, more 2 lights is possible to obtain a result a little more accurate:

In both cases I’ve used the same technique: Gradients based on distance of Null objects; this can be made with LW gradients or with FIsLocal Ambient shader. This tutorial will only explain how to use this technique with LW gradients.
Before anything we should have clear how the light behaves in the nature or to guide us by photographs or a preliminary render with GI.
We begin loading our room and diminishing the Light intensity and the Ambient Intensity at 0; what we have now is a dark room. Either that we use spinning lights, FPrime or SG_AmbOcc shader, is advisable to separate in independent Layers the floor, the ceiling and the walls. We change the Backdrop Color to white, we go to surface panel and adjust all the surfaces with Luminosity to 80% aprox:

We add a Null and position it to the center of the scene (like a point light) to simulate a basic effect of ambient lighting:

Subsequently we add a gradient in Color Channel, Blending Mode: Additive, Layer Opacity 40 aprox. (this value represents the environmental interior light of the room):

The idea of leaving the second Parameter with alpha in 0% is that this will maintain the intact color base.
To have a little more clearly idea of the final result, we add the SG_AmbOcc shader of the brilliant Skidbladnir.

I’ve chosen a dark yellowish greenish neutralized color for the shades, because this the color average of the whole scene (green + orange + cyan + white) but later this color will vary depending on the surface (blued for the blue wall, orange for the orange wall, etc)

Then we continue with the ceiling, what we should make here is a gradient that goes from the blue color toward the orange one; for this we should consider that for LW the starting point of the gradient (first Parameter) is the position of the Null object; in this case we will use X_distance_to_object, since the walls that affect to ceiling are the lateral walls, this will provide us a lineal gradient in X. For this we add a Null in the inferior extreme right (doesn’t care if is superior or left, the important thing is that is in an extreme and depending of which it is, we set our gradient; in our case, is this way:

Notice that there is a parameter between the blue color and the orange one (is an intermediate greenish color) which we have set with a low value in alpha so that the center of the ceiling is not affected by the colors of the extreme, since the influence of the lateral walls is not so long;

also notice that we have diminished the value from the first gradient to 20%, is this way because we will add a third gradient that will simulate the rebound of light from the floor toward the ceiling.

In both cases we have chosen Blending Mode: Multiply, since in the reality these bounces only tint the surfaces but they don’t add luminosity (what would happen if we used bounce-lights; here the gradients advantage ).

Is the moment to say that the direction of the main light (Keylight) will be from right to left and will enter through the door (could enter through the window and we would have a nice back lighting but we will make it through the door to hinder a little more the things This means that the light that enters for window is not direct but indirect and this can also be simulated with gradients.
For this we add other Null in the superior part of the window and we set an additive gradient since indeed this gradient provides luminosity to the surfaces:

Still lack to add the keylight (is advisable to make it first but I haven’t made it to show the result of the gradients without lights that modify it). at this time we can say that the ceiling is ready, at least in what refers to bounce light effect.

Is important to keep in mind the place where the Nulls objects are located to optimize to maximum their number, using the smallest quantity possible. We see it in the scene:

We study the position of this Null object for example:

and to set the gradient of the blue wall (light that bounces from the green floor to the blue wall):

As we’ve seen the Null serve to set the ceiling gradient, but also serve us to set the floor gradient (light that bounces from the blue wall to the floor):

This other one:

It serve us to set the rebound from the floor to the orange wall:

And from the orange wall to the white wall:

And from the blue wall to the white wall:

Is even possible to take advantage in the scene of other objects that aren’t a null, as for example in the case of the white wall of the front, we have used as reference the floor to simulate the greenish rebound toward the wall:

All these gradients can be used in the same way with FIsLocalAmbient. To explain the idea we will do it with an element inside the scene (this can be applied in the same way in the walls). we load a small sofa and add the SG_AmbOcc plugin first and then FIsLocalAmbient in the second shaders slot, we adjust the value of FLA in 80% and the Luminosity from its surface to 20%; what is equal to 100% in total, this means that our sofa will be more sensitive to the light than the rest of the room. Subsequently we enter to the properties of shader texture (this is something that I hope Skidbladnir adds to his SG_AmbOcc).

We begin with the gradient that will simulate the greenish rebound of light of the floor:

As we can see we have used the floor like Object Reference:

We continue with the orange rebound using the Null of orange wall:

And with the blue rebound using the Null of the blue wall:

Ok. Is time of putting our Keylight. If we are using an ambient occlusion map we can use Fprime and simply add an area light; but to stay in LW we will use spot_light that moves, to simulate the effect. Our Keylight is as follows:

In this direction in the frame 0 and frame 1:

Pre and Post Behaviour Repeat:

We should also add something of light in the ceiling, so we add another spotlight This way in the frame 0 and 1:

Pre and Post Behaviour Repeat

Since the keylight is hitting the center of our orange wall, we should adjust the first gradient this way:

The color of the gradient is yellowish because this is the color of our keylight. We activate Motion Blur to 50% and we render the frame 1

Here a test with an area light:

This image took as 1 min for render with LW native render (PIV 2Ghz)
It’s all, if somebody wants to take a look at the scene, you can find it here:

If you make something interesting with this technique or you discover something new with it, please let me know 🙂
(Note: The paintings of the living room are black&white versions of the painter’s works and sculptor José Carlos Vargas)

(c) Gerardo Estrada,


  1. Venus /

    Really woow, thank u so much for sharing.

  2. xaiya /

    wow that’s amazing! thanks for sharing

Leave a Reply