Procedurals Tutorial

WORKING WITH PROCEDURALS  

 

 

Well, not a impressive image, I know but it has some particulars that makes it little bit special:Not a single bitmap texture it´s been used to achieve it. Only 3D procedurals have been used instead. Since 3D procedurals are projected on the 3D space and effects as Ambient Occlusion depends on the geometry only, it avoids the UV mapping work required for a bitmap texturing version.

So, we gonna learn how much powerful procedurals are, and also some basics regarding shading/lighting.

 

 

Create the main light.

Usually we should avoid frontal lights (except if we want to render a camera flash effect) because shadow zones are pretty important for a nice well contrasted image. Frontal light always cast very flat images, so it may be better to choose a light angle allowing some important black space in the image (black areas will be filled with ambient light later).

 

Now, we gonna do a fast GI simulation using few omni lights arranged like a hemi-sphere (dome) so we can cover the whole scene from some different angles.

Result is not realistic as GI and it doesn’t works fine for all scenes but rendering time is pretty fast and scene is more rich in specularity.

Using instances from a “master” light makes it more comfortable, so by setting the “master” you can handle the global illumination from the whole light dome.

 

So, let’s go to the texturing stage.

In total, we gonna need:

Noise (fractal noise) to create irregular noise patterns for the materials color as well as for the specular masks.

Gradient, for a very basic fake sky (enviroment)

Fresnel for filtering reflection

Fusion for mixing textures

Ambient Occlusion (from Effects tab) to add rust in specific areas

Surfaces (tiles) to create the lines for the floor object.

  

 

For the background wires we gonna use a procedural noise for the color property (FBM noise in this case) so, once one material works fine for one wire we can duplicate it and just change the color for the other wires.

Since plastic is a quite reflective material, activate Reflection but instead to let the reflection slot empty or using a bitmap we can use –Fresnel– .

Fresnel casts a physics property were faces perpendicular to viewer gets bigger value than the frontal ones.

Fresnel it’s useful specially on glass surfaces, loaded in the transparence slot (refraction) to increase opacity-reflection in the edges to avoid the typical “clipped object” edge effect but it’s used generally on all reflective-refractive surfaces for a more physically accurate rendering.

A good example to understanding Fresnel on flat surfaces it’s a clean window glass which looks fully transparent when frontal but almost like a mirror when perpendicular to viewer (this is very important on animation renderings).

In this case, we use the Fresnel just to increase reflection on edges, allowing also some less-reflective areas (so less exposed) allowing specularity to shine on these.

Also we can filter the specular “pattern” by filtering the Specular Color slot with another fractal noise (Notuous this time) in order to cast a more aged aspect for the plastic.

 

For the floor or desk (quite undefined actually) of the scene, we can add also a Linear pattern in the bump slot which we can get from menu Surfaces>Tiles.

 

Because we are working with reflective objects we need an enviroment to be reflected.

A fast solution without using bitmaps is creating a Sky object and add a texture created with –Gradient- which shows a very basic vanilla haze plus a blue gradient.

Is not very detailed (we could add also other layers using fractal noise as alpha for creating clouds) but it’s enough to cast something reflected in this test.

It’s time now for texturing the bolt that’s the main object in scene.

Start by creating a very dark material (that will be the maximum dark threshold you can get in that surface, so if you’re thinking on chrome or a mirror you should use black, grey for aluminum, etc.)

We add reflection and load some noise (Luka in this case) in the bump slot to create some manufacturing imperfections and some aging).

 

Even if not strongly apparent in some cases, the Fresnel property aids to increase realism by the difference on reflection amount depending on the faces angles as it happens in the real life.

Using the Fresnel gradient ramp (black=no reflection ; white=full reflection) we obtain a global medium gray like the used in the version at left (about 50% reflection amount) but casting more local contrast (right):

Both images looks similar, but we can see that in the version at right the reflected gradients are more contrasted (it the same principle we´re looking for when using HDRI images) showing even subtle overexposed areas, but the most evident effect is on the bolt spiral which looks very well defined now.

So, Fresnel add sometimes very subtle but important improvements.

 

Now we create a full rusted version, which we’ll mask later for some specific areas in the object.

First test is done using a fractal colored in orange tones (Luka) without reflection and specularity at all since rust looks matte mostly.

It doesn’t looks bad at all, looks quite casual, but by trying to avoid a patern too easy to identify by the human eye by scaling up the noise (1.000%) some little detail is missing, so even if looks very casual because there is not any obvious pattern, there is not any rust grain at all.

 

Here the noise at 100% scale. It looks regular too much at such small scale, but we got some kind of “grain” as rust normally looks like.

It would be nice using this version to keep some grain, but the hyper-scaled up version looks pretty casual … so which one should we choose?

 

The solution comes by a image mixer like Fusion, which allows to blend two channels using a slider and also suits amask if needed.

For the rust, we goona use just a mix at 50% so we can get the best of both noises.

To do that just copy-paste the original materials in either Blend Channel and Base Channel slots and move the slider about 50%.

Now, one of the most funny parts of this test, mixing the textures on the object.

Get the rust material shader obtained with Fusion and load Ambient Occlusion in the alpha slot.

Ambient Occlusion normally is used to do just that, ambient light occlusion but in this case it’s ideal to use it as a mask for the rust because it cast more rust in the areas where there is less evaporation, so in the joints.

To do that, drag the texture on the object with the chrome texture already applied so you will get a secondary texture on it (if using Object Manager don’t drag onto the chrome texture to avoid overwritting it instead to adding) so in the Object manager we should see two textures tags on the same object.

Don’t activate “mix textures” on the material properties because it just creates a equalized blending of all the stacked textures, while we want instead the alpha slot (Ambient Occlusion) to take the control about how the mixing is done.

 

Well, it looks interesting, but real rust doesn’t behives so mathematically because there are factors altering the material other than evaporation-oxidation such as differences in the material blending, bigger pores, material irregularities, partial covering, etc so we need some more random rust for the rest of the object other than joints.

 

Duplicate the rust shader but in the Alpha Slot use another noise instead Ambient Occlusion to change the type of coverage for the rust.

By doing some tests, we realise that the result is more soft (blur) than we´ve expected, so the expected well contrasted areas with no rust at all / fully rusted, are not working very well.

Solution comes again by Fusion.

Get the same “soft” noise and paste it onto the Mask slot in Fusion leaving the Base channel empty since we want just to apply a well-contrasted mask for the rust noise.

By using this, finally we achieve full 100% opaque areas plus half-transparent areas which fits better to the result we were looking for. Now it looks more natural.

 

By dropping the rust shader (The one using Ambient Occlusion as alpha) onto the “ground” object (the stripped one) we can get some orange occlusion around the bolt and cables looking like if some rust and dirt was gattered under the objects, so that’s a good aid to create the illusion than time has passed by the scene.

 

Final conclusion is that this test is just one of the so many ways to deal with procedurals.

We could apply the same technique with tons of variations, more or less rusted (changing brightness-constrast in the masks), adding some small bump in the rust to improve the pores of the rust or even changing the colours to create another materials like in this example where we can see also a bronze version with just a few changes in the shaders.

Just release your imagination 😉

 

Carles Piles 2006

 

 

Moncler outlet