XaiJu
Kruithne
Kruithne

patreon


WoW 3D: Everything About Foliage

Foliage is an important part of most 3D scenes. Most people think of foliage as strictly plants and grass (as per the actual definition of the word), but when it comes to games (especially WoW) this extends to any form of ground clutter - rocks, skulls, etc.

Use of foliage can often be the difference between a scene looking polished, or looking empty and unfinished. In this guide, I'm going to cover all of the bases with foliage, from how to export it, best practices, and the best methods for putting it into a scene.

As with all my WoW 3D guides, this will be aimed at users of Blender since it's my own weapon of choice, however the methods should be applicable to other 3D applications. We'll also be using wow.export (developed by me and Marlamin) for the exporting.

Exporting Foliage

Let's start at the beginning. While you can use any 3D object for foliage, we're going to be sticking with actual WoW foliage for this guide. The quickest way to find foliage objects is to search for world/nodxt/ in the Models tab on wow.export.

Once you find the foliage you like, simply export it as an OBJ and then import it into Blender. Since most foliage (flowers, grass, etc) will use transparency, make sure to apply that as needed (see shader below).

Now, manually exporting foliage is obviously quite slow, especially if you don't know the names of foliage for a particular zone. To speed things up, we've included an Export Foliage option in the map exporter. Simply select a map tile and ensure the option is toggled before exporting.

Once the export is completed, you'll find a foliage directory inside the exported map directory. For example, if you exported a map tile from Eastern Kingdoms (Azeroth), your foliage will be in <export directory>/maps/azeroth/foliage.

Placing Foliage - The Dirty Way

The quick and dirty method to placing foliage around a scene would be to simply grab the object and duplicate it all over the place, scaling and rotating them as you go. While this can be fine for specific placements or small areas, this is obviously not ideal.

However! If you do end up going this route for any reason, be sure do use Alt +D to create a clone object, rather than Shift + D. This re-uses the same mesh therefore reducing GPU memory used and increasing render speeds.


Placing Foliage - The Chaotic Way

A newer feature of Blender is the Scatter Objects add-on. Even though it comes with Blender by default now, you may need to enable it under Add-ons.

To use this add-on, first select the objects you want to scatter, and then last select the object you want to scatter them onto. From your action menu, select Scatter Objects.

You can now draw on the mesh where you want to scatter objects. Be sure to open the Active Tool and Workspace tab for fine control over the scattering as you go.

Once done, just press Enter and the objects will be scattered. Personally I find this method is great for scattering rocks and rubble over large scenes - just be sure your rocks are a full mesh if you use the rotation value for the best results (bad results shown below).


Placing Foliage - The Best Way

The best way to apply foliage to a mesh (such as terrain) is to use a particle emitter. However most people do this with a vertex group which isn't great, so be sure to check the following sections as well.

To start with, put one of each type of foliage you'd like to include into a collection of their own off to the side. Call that collection something like Foliage.

Now, select the mesh that we'll be applying the foliage to and in the Particle Properties tab, add a new emitter with the Hair type selected.

All of those lines bursting out of the plane are going to be individual pieces of foliage. On the same Particle Properties tab, go down into the Render section and change Render As to Collection. Then, change the Instance Collection to the collection we created earlier named Foliage.

Just that like, we have randomized foliage on the terrain! You can play about with the settings such as scale, number, seed and so on to achieve different results depending on what kind of density and spread you're looking for.

Controlling Foliage - The Dirty Way

Applying an uncontrolled mass of foliage onto a plane is one thing, but in most cases we'll want to control where the foliage actually renders to avoid buildings, characters and follow terrain textures.

The most common way to do this is to create a vertex group to define the density based on selected vertices. This isn't great for a number of reasons, but let's do it first.

Start out by entering edit mode on your terrain mesh. You'll need to make sure that you have plenty of vertices to work with (the more vertices, the more control you have). If your mesh is a normal plane, subdivide it until you have a decent amount of quads (or triangles).

Select the vertices and then on the Object Data Properties tab, create a new Vertex Group and click "Assign" to assign your current selection of vertices to it (shown above).

Tip: You can quickly select vertices in Blender by pressing C to enter brush selection mode. This often saves time when selecting terrain vertices!

Once you've done that, go back onto the Particle Properties tab and under Vertex Groups assign your newly created vertex group to the Density control.

Now your foliage will only be active on those vertices, as shown above. Let's discuss the downsides of this method.

Controlling Foliage - The Better Way

Now that I've finished condemning vertex groups, let's get into my preferred solution: texture mapping! If you're already followed the above step, delete your vertex group.

Start by adding a new material to your mesh. Call this something like FoliageMap and assign it a new texture. The size of this texture depends on your use-case (the bigger the finer the control, but consider memory costs). For this example, I'll be using a 1024x1024 texture. You can disable the "Alpha" channel too. Be sure to give the image a name too, such as FoliageTex.

On the same mesh, go onto the Texture Properties tab and add a new  texture for the ParticleSettings. Under the Image section, select the image FoliageTex that we just created for our material.

Once that's done, you'll notice a new section called Influence has appeared. Under this section, tick the box next to Density.

If everything went to plan, you should notice that all of your foliage just disappeared. That's a good sign! Now the density of your foliage is controlled by the image we created, with foliage appearing based on how white a pixel is.

To demonstrate, go into Texture Paint mode and draw yourself a white squiggle (be sure you have FoliageTex selected before you start drawing). You'll notice that in the 3D view, your foliage has now appeared in a squiggle!

Those of you who are observant may have realized that we added the foliage mask as a material on the mesh when you didn't need to. The reason I do this is so I can target the mask for texture painting in the 3D view, allowing you to paint foliage directly on the terrain.


Controlling Foliage - Bonus Round

For those of you that read my previous guide on achieving in-game quality terrain, you may remember that terrain textures also use the same kind of masks. If you've already thought about combining the two, you're absolutely right.

Using the texture masks from that guide and using them as the texture mask for the above section allows us to define foliage based on the actual in-game textures. Just be sure to either split the R, G, B channels to separate textures, or mix them in separately. Magic!

Foliage Shadows

As a closing note, let's gloss over foliage shadows for a moment! By default, everything object in a 3D scene will cast a shadow.

This can look quite nice if you're aiming for a realistic art-style, however most of the time with WoW artwork this can cause quite strange and unfamiliar looking foliage especially in exterior scenes. This is because foliage in WoW doesn't use shadows - at all!

If you're aiming for WoW-style artwork, be sure to turn off shadows for foliage for that extra authentic look.


WoW 3D: Everything About Foliage

More Creators