Forest Pack isn't just for plants. It's also well suited to adding furniture and characters to the interiors of large buildings to quickly fill a huge area over a number of floors. Instead of painstakingly placing thousand of objects, let Forest Pack do the heavy lifting for you and scatter random types of furniture on each floor. In this tutorial we'll share a collection of tips and tricks for populating building interiors focusing of 3 possible scenarios:
For each of these scenarios we want to be able to do the following.
As a bonus, we'll also look at how to create the floor plates using RailClone, and examine how Forest Pack and RailClone can work together to create a fully parametric system that includes façade, floors and furniture.
The exercise files for this tutorial includes the following .max scenes compatible with Max 2010 and V-Ray.
All furniture and computer models with the exception of the desk are used with the kind permission of Dimensiva. For many more high quality free models please check out their website. This tutorial also uses several Populate characters that have been collapsed to an editable mesh, but for better results you may wish to source 3rd party character models.
The Screens on the Macs, the chairs and the seated people have had their textures randomised for more variation using the Forest Colour map, you can find an depth tutorial on this here.
The objects scattered in this tutorial
To use this mode you will need to add each individual floor to Forest as a separate surface. Adding surfaces separately retains most of Forest Pack's features and is very easy to use.
When adding groups to Forest Pack, you cannot pick them directly from the scene. Instead you can either use the Add Multiple button to select them using an object picker as describe above, or click on to add a single object, click on Custom Object and then click
. Next press H on the keyboard to open the Pick Object dialog, select a Group from the list and click Pick.
Adding Variety to each floor
When using the Full map type, the distribution is very dense. In this section we'll scatter a "null" object and adjust the probability vallues of the furniture to create gaps in the furniture layout.
If you look at each floor, you'll notice that the objects, their distribution, and any randomised transforms are exactly the same. Fortunately this is easy to fix:
Preventing interpenetration with the façade
Looking at the resultant scatter from the top view, it's obvious that there are some objects that are extending beyond the edges of the floor plate.
This is because Forest uses Point mode when scattering on surfaces to determine if an object should be culled. This presents a problem as these objects could extend through the façade. In this step we'll remove them using Exclude Splines.
Preventing interpenetration with the Façade if the building's profile changes
The exclude spline technique cuts through the entire height of the building, so it is ideal for structures that retain the same profile throughout their height. If there are only a couple of shape changes, then the easiest solution is probably to divide the building into multiple Forest objects, one for each new profile. But for buildings with highly variable profiles like the simplified example shown below, this would mean a lot of Forest Objects!
For this type of buildings, instead of using splines to exclude objects, we can restrict the scatter to particular material IDs. In this example we'll offset the floor plate to create a perimeter ring of polygons and change the Mat ID, but before we do that, let's apply the existing Forest Pack object to this new set of floors.
Limiting scatters by Material IDs was introduced in Forest 4.3. It's not just useful for preventing items getting too close to the perimeter of the building. You can also use this feature to limit furniture to particular floors, rooms or even parts of rooms. You could for example have one forest object scattering desks on ID1 and another scattering filing cupboards and shelves on ID2, or you could use IDs to designate types of habitation for example ID1 = retail, ID2 = office, ID 3 = residential etc.
In the previous exercise, each floor plate is a separate surface. This may not always be possible as you may have a more complex and combined mesh for the internals of a building. In this case we can use the UVW space of the surface to scatter objects.
Using UV Mode
Adding Variety to each floor
The scatter is exactly the same on each floor, this is because the UV mapping on each floor is also identical. To add variation to the scatter when using UV mode, it is necessary for each floor's position in UV space to be slightly different. To fix this:
Preventing interpenetration with the façade
Open the Areas rollout and you'll notice that many of the features are disabled in UV mode. Consequently it is not possible to prevent scattered objects coming too close to the exterior of the building using either splines or material IDs. To achieve this in UV mode we have to be a little more inventive, and in fact the only way to really control this is using the Distribution map itself. Essentially what is required is to create a map for each floor with a white area where you want furniture and a black area where you do not. There are any number of ways these maps could be created. You could for example hand paint them using Viewport Canvas or bake them out using render to texture and Colour Edge, but the important thing is that the maps must be able to be evaluated before render time in order to work correctly. In this example I will create a white map in UV Space -1 to 2 and ensure that all polygons that should produce furniture are mapped to this area. Anywhere outside that UV space will be black, and any polygons that are not to host furniture will be moved outside this range:
Creating vertical zoning
Finally you may also want to limit the distribution in the building to particular floors. You could do this using the technique described above by adjusting a whole floor's UV coordinates, or alternatively you can achieve this based on the height of the building. To do this.
In some cases it may be possible to use RailClone to create floor plates. When using RailClone you will have to use the UV mode as described in the previous section, but using RailClone has advantages because it allows you to parametrise the randomisation of the floor plate's UVWs to create distribution variations on each floor. This means there is no need to use the UVW unwrap modifier to manually assign each floor plate to a unique UV space.
Randomising UVWs using the XForm Operator (works with RailClone lite)
In this exercise we'll use RailClone to create a vertical array of floors. To do this:
Preventing interpenetration with the façade
We're using UV mode, so the best way to control the scatter is still using the distribution map as described earlier. The only real difference is that we only need to edit a single floor mesh, because RailClone will duplicate the geometry on every level. This also explains why we make the white area of the distribution map extend slightly beyond 0 -1 UV space. If we didn't the UVW XForm randomisation effect could cause unwanted black areas to appear in the distribution map.
Use UVWs to control the rotation of objects
If you look closely at the alignment of the desks in relation to the building perimeter, you'll notice that they are all facing the same way, irrespective of which side of the building they are on. Ideally we'd like the desks to rotate to remain in the same alignment in relation to the building's footprint. We can't use the transform by map settings for this because the desk, chairs and computer are grouped, so they'll only rotate around their ownlocal axis. Luckily though, we can achieve this effect by aligning the scattered objects using the surfaces UVs. Here's how:
Creating the RailClone interior, an alternative approach (Compatible with RailClone Lite)
In this example, instead of using RailClone to create a stack of surfaces, we can use it to add a 2 dimensional array of rooms around the perimeter of the building. This style uses two room models -one with and one without a wall - and 4 corner segments with different internal wall configurations. The more of these you add the greater variation you can achieve inside the building.
The rooms have already been mapped so that the perimeter's UVW are moved to the black area of the existing distribution map using the technique described above. In addition there's a V-Ray light material on the ceiling that we can randomise in RailClone to turn lights on and off. Let's use these objects and create a new style:
You can now use the same technique to add some people. To do this;
We've now populated the interior of this building with people and furniture. Moreover this entire set-up is fully parametric. If we change the size of the base spline, the rooms, furniture and people all update automatically!
To round up this tutorial, let's create a couple of RailClone styles to add a façade to this building. To maintain compatibility with the Lite version we'll split the facade into 2 separate RailClone objects but they could easily be combined if you are a Pro user.
This styles each use two segments. For the windows, a corner and the window itself:
And for the support bracing, a single diagonal and a corner:
The aim with these styles is to maintain instancing support as much as possible. To ensure this, none of the segments are sliced or bent and the Corner segments have been pre-sliced before adding them to RailClone. Here's how to construct these styles.
Creating the Window style
Creating the Diagonal Braces
To create the diagonal braces we'll use the same technique, but with the addition of mirror and sequence nodes to re-use a single diagonal component and create a diamond pattern. To do this:
To finish up we'll restore the full height of the building. Before you do this make sure you go to the display rollout for both RailClone objects and set the Viewport Mode to Adaptive. You can then set the height of the building in the Parameters rollout found in the ModifyPanel.
Once this is done, you're ready to render!
In this tutorial we covered a number of useful techniques for scattering objects onto stacked surfaces. Although the focus was populating the inside of buildings, it is our hope that some of these tricks will find usage in a much wider range of applications. If you have an interesting project please feel free to share it on our forum and stay tuned for even more Forest Pack and RailClone training coming soon. For more information about the features demonstrated in this tutorial, check out our reference section or visit the tutorials page for more Tips & Tricks videos and in-depth tutorials.