Rollover image to view Procedurals


Procedural allow you to keep your working scene light and workable by deferring the loading of geometry data until render time. It is possible to add huge levels of complexity to your scene with very little effort. In this introductory tutorial, we will show you the steps required to set up a complex scene, very simply, using procedurals.

The scene can be downloaded here.

 

The following steps introduce several useful points about using procedurals (you might like to follow them using a suitable model of your own). Note that this tutorial is only an introduction to procedurals, which are a very powerful tool.

  • Open the model that you want to duplicate using Arnold's Procedural node. Make sure that your model and shading are complete before exporting the model, as you will not be able to modify it after you have exported it. To export the model, go to the System tab in the Render Setup window. Enable 'export to .ass'. 

Export model as a Procedural from the Arnold menu

Export .Ass File

  • Choose where you want to export the model you want to use as a Procedural and render the scene. Arnold exports your mesh as an .ass file, which contains everything that is needed to render the mesh. 

Create Procedural

  • Create a new scene. Create a new Procedural by going to the menu in the Create tab and choosing Arnold. Select Procedural and create the procedural by clicking and dragging in the viewport.

Procedural

 

  • Select the Procedural and under Path, choose the .ass file that you exported as the Procedural model.

Soldier.ass file loaded in Procedural

 

  • You should notice the shape of the Procedural's bounding box change to match the shape of the original model. Position it so that it rests at the center of the grid. Position the pivot at the bottom of the Procedural. This will help us when positioning our instanced Procedural models.

Lighting

  • Create a Distant light. Point the light at the Procedural and render. You should see the original model with its original shader assignment. If you need to change the shader, you will have to repeat the above procedure by re-exporting the Procedural or assign a new shader to it.

 

  • Create a polygon plane and scale it up high enough to use as a floor plane for our procedurals. Assign an Ai Standard material to it and assign a wooden floor texture to the Color, Specular Color and Bump map slots. Increase the Specular Weight to around 0.3 and decrease the Specular Roughness to 0.2. Enable Fresnel and increase the Reflectance at Normal to 0.05.

 

So, with one instance of our Procedural geometry, you should have something like the following image.

 

Instancing the Procedural

  • Now the fun part. Let's start instancing the Procedural. First, set the pivot point correctly. Move the Procedural a few units away from the center and place its pivot at the 0,0,0 center of the grid.

Move Procedural away from the center but move its pivot to 0 0 0

 

  • Now we need to instance the Procedural. This is very important, as it will save you memory and your scene will render faster. Change the Y rotation to 10 and increase the number of instances to 36. You may need to change the rotation value according to the size of your model. Otherwise, your instanced procedurals may penetrate each other. Make sure you delete the original Procedural. Otherwise, you will get duplicate geometry.

 Procedural's instanced in a circle

 

This should result in something like the following image.

 

  • Duplicate one of the Procedurals, move it out to the side and position its pivot in the 0,0,0 center of the grid.
  • Duplicate the procedurals using the above procedures. Remember to instance them.

 

You should now have two rows of the Procedural model. Using the same method, we have created another Procedural for the standing soldier. However, the number of copies has been increased to 72 to compensate for the larger circumference. Also, note that the standing soldier Procedural is intersecting the sitting soldier procedurals. In this case, it does not matter as it is only his gun that is overhanging the sitting soldiers.

 

The procedurals can be instanced many times with little overhead to rendering (the original model has around 20,000 polygons so without instancing using procedurals the following scene with hundreds of soldiers would be quite large). Arnold, of course, has no trouble rendering the scene.

 

Conclusion

It's worth pointing out that this introductory tutorial has only covered the basics of using procedurals. For example, as well as using .ass archive files, procedurals also work with pre-compiled custom procedural programs which you can provide in the form of a dynamic library, allowing you to use parameterized procedural geometry. Procedurals can also be recursive, and you can defer loading of the procedural geometry until it is needed during rendering (i.e., the geometry is not loaded, and uses no memory until a ray enters the object's bounding box). These techniques make it possible for you to assemble scenes in a modular way.

 

You can see the creative potential that procedurals can give you. Below are some further examples that will hopefully inspire you to create your own. Have fun with procedurals!

 

Thanks to Angel Jiminez for the use of his facial co-ordinates

For more details about procedurals in MAXtoA see the main Procedurals description.

  • No labels