This is a guest tutorial by Mickael Riciotti, environment artist at Unit Image in Paris. Inspired by a recent article on FXGuide about creating the sand in Houdini for Pixar's piper, Mikael wanted to see if he could create a similar look with 3ds Max, V-Ray and Forest Pack Pro. We think the results speak for themselves.
In this tutorial, we will see how we can use Forest Pack's "Forest Color" map features along with various optimization tricks to recreate sand macro-photography. When dealing with extreme close ups on a grainy surface like sand, a displacement map may show some stretching and you will need to increase the subdivision substantially to get the amount of details you need. Moreover, sand is translucent, so having separate geometry for each grain of sand will help with scattering light and bring far more realism to your image.
Before we scatter grains on our beach, we'll need a basic ground and lighting, to create this:
Forest Pack can handle a huge amount of geometry, but it is more efficient if you limit the number of instances it has to create. This is why instead of scattering individual grains, we will be creating patches containing multiple grains and use them as our source geometry.
Create a sphere and squash it a little bit vertically. Add a FFD (2X2) modifier to it and deform it randomly. Duplicate it and tweak the variants so that you have enough difference between your grains.
Once you have created your patch, add a ProOptimiser modifier to it, followed by a turbosmooth and a noise modifier. This is to break the roundness of your grains and add crispy details to catch specular highlights.
Repeat the process to generate different patches. In the image below, I created 8 variants: 3 single grains, 2 large patches, 2 medium patches and 1 tiny patch.
That's all there is to the modelling !
The forest pack setup is quite straightforward:
If you were to render now, you would scatter grains of sand on a huge surface and reach the maximum number of scattered items that Forest Pack can generate.
As mentioned above, we are already culling our scatter to the frustum of the active camera, but you can also limit it to only that which is close enough to the camera to be noticeable. This scene uses a lot of depth of field, so you can get rid of the grains that are far away and out of focus., to do this:
First, we'll need to fix the probability of our scattered items. The bigger individual grains are to be used sparingly to break the overall model and as such they need a very low probability.
You can edit probability by selecting an item from the list, and editing the value of the Probability
parameter, just above the material slot button in the Geometry rollout. Here are the
settings I used:
These settings give you a much more naturalistic distribution:
To refine further, In the Surface rollout, change the Direction from Up to Normal. This will force the patches to align to the surface of the beach and follow the small variations of angle.
Finally, in the Transform rollout, enable Position, Rotation and Scale checkboxes, and use the following settings:
This will help breaking the grid pattern of the distribution map
With all these settings applied, here's what you should get now:
Open up the material editor and pick the materials applied to the sand objects. By default, Forest pack automatically generates this material based on what you assigned to your source objects. To edit the material you use the material referenced at the bottom of the Geometry rollout, or pick it from the source geometry itself. It is not recommended to edit the multi-sub object material applied to the Forest object, as this is generated automatically and might be overwritten, in which cases changes will be lost.
Basically, we will be using the texture provided as a source for Forest Pack to randomly choose colours and assign it to our scattered objects. Element mode will assign a different colour to every individual grain, and not just every patch.
The texture was generated by sampling colours from an actual sand photograph. The number of pixels that each colour uses is very important, because it will define the probability of that colour being chosen by Forest Pack. As you can see, most of the texture ranges between brown and beige, and you have 1 dark pixel, 2 bright pixels, and a saturated orange one. As a result, roughly 10% of our grains will pick one of these more extreme colours, and the rest will be shades of brown.
Just like we saw above, this will randomly assign a reflection value to our individual grains of sand. But this time, we'll be using a simple gradient instead of a custom map to drive the various colours our grains can use. If you render now, you should get something similar to this:
If you look closely, the brightest grains of sand look quite dry and non-organic. If you observe sand closely, you will see that it actually it's a very translucent material. We will use refraction to emulate that, and to add some variation too, we'll use the Forest Color map again.
If you render now, your render-time will take a (very) serious hit, since you will basically be rendering thousands of diamonds - but your grains of sand will blend a lot better:
The effect is even more noticeable on a close-up.
Because using refraction is extremely costly, you can use the following trick to make things lighter: In the Forest Color map, in the Refraction slot, instead of using a gradient set the mode to Random from Map and add a black and white bitmap, similar to the one you used in the diffuse slot, made of 4 pixels: one white, one black and 2 shades of grey.
This way, you will force Forest Pack to limit its range of colours and include more fully non-refractive grains, thus reducing your render times.
Your sand is ready, you can now add a little bit of post production to emulate camera aberrations - for example some chromatic aberration, a vignette, and glow/diffusion.
Now we have our basic sand, we will make an alternative version of it, wet sand!
In the diffuse slot, nest the Forest Color map under a composite map, and add a new layer on top. Plug a brown V-Ray Color (value r:86 r:69 b:58) into this new slot and set to mode to Multiply. This will darken our sand to make it look wet.
Go to the Forest Color map in the Reflection slot and boost the right color of the gradient to a light grey (value: 180) so that it is looks more reflective.
You're done! Hit render, and add some post-production to it, just like you did with the dry sand.
This concludes this tutorial. Of course, feel free to take it further and add seashells, pebbles , debris, sticks, etc. You can also customise the deformations on your sand surface to add human foot or bird prints. Also play with your camera distance and angle and see if the optimisation settings still hold up; your creativity is the limit!