In this tutorial, we will be using our Merged Mesh system and show you the process of how to setup bendable grass blades. Merged Meshes are mainly used to handle areas with dense numbers of vegetation objects like big fields of grass. Merged Meshes also allows the usage of a rope based bending effect. Ropes get generated for each asset instance to bend it upon impact.
Contrary to bone based setups like Touch Bending, ropes can be cheaper and get affected through the global wind and our Breeze Generation system. Large fields of grass are perfect examples to showcase this type of technology since each asset instance can be merged into bigger clusters through the merged mesh system. So for this tutorial, we will create two simple grass plane assets as a base for a dense overgrown grass field.
Pic1: Dense grass field affected through wind
Pic2: Two assets that this entire grass field contains
Source Maya scene with exported CRYENGINE files:
Before you continue with this tutorial, make sure to have read and understood the following:
Make sure to keep the following things in mind while you work on your assets:
Merged Meshes has some improvements but also some missing features compared to Touch Bending. This table gives you an overview about the differences between those two systems. Use this to decide which type of feature works best for your asset.
Description | Merged Mesh | Touch Bending |
---|---|---|
Type of bending | Ropes | Bones |
Instance merging to clusters | Yes | No |
Influenced by Wind | Yes | No |
Influenced by Breeze gen | Yes | No |
Requires simplified geometry (low poly count) | No | Yes |
Bone parenting support | No | Yes |
Proxy support | No | Yes |
UV instancing for bones | No | Yes |
For this tutorial, we will be creating our asset in the following directory.
<Your_Project>\Assets\
Objects\tutorial\vegetation\02\grass\merged_mesh\
So to begin with, save your Maya scene to this location. All our exported assets will be saved in there. Some of the textures we will use comes from an already existing asset and we will point you to the directory where they are later in the tutorial.
We will continue with the assumption that you have already created the asset, since this is not a Maya modeling tutorial. We will begin with preparing the asset ready for CRYENGINE and configuring the material.
Pic3: This is the final exportable scene hierarchy
To have an exportable scene from Maya, you are required to give the geometry under your cryExportNodes some materials. So, create a new Material Group and one shader, and assign the shader to this Material Group. This shader should point to the diffuse texture you want to use for the grass blades. Use the MAT.ED shelf icon from your installed Crytek shelf:
Pic4: Setting a new Material Group and adding a shader to this material group
Your exported CRYENGINE material file should be located here:
<Your_Project>\Assets\
Objects\tutorial\vegetation\02\grass\merged_mesh\tutorial_merged_meshMAT.mtl>
Pic5: Generate a standard material for export. This will be finalized inside CRYENGINE material editor later
Our geometry for this tutorial is going to be two patches of grass blades. Keep in mind that we will place several hundred thousand instances of those two assets throughout our scene so keep your triangle count as low as possible.
Create a single plane mesh for your first grass patch, divide up the shape into a similar polygon configuration and apply the material we just created to it (tutorial_merged_mesh_SUB). With the grass blade geometry selected, open the Maya's UV Editor to adjust its UV shell to only fit around one of the grass patches on the texture. Create a copy of your mesh and move its UV shell to a different grass patch
Adapt the shape of both meshes to their applied textures. Finally name your two grass objects as:
Pic6: grass blade geometry with their UVs tweaked to match the grass texture
As you have seen in the images before, we already have some locators created. For CRYENGINE's vegetation system to see it as Merged Mesh and being bendable by the environment wind system, we must create three Locators, which should be placed one at the bottom, one in the mid section and one at the top of the grass blade. Their names must follow this convention:
Note how we do not have to snap the locators exactly onto a vertex like the touch bending setup. You can if you want, but it is not required by the merged mesh system.
As with all Maya to CRYENGINE exports, you must create a separate cryExportNode for each asset. Since we are using two variations of grass blades, we should create two cryExportNodes. Move the locators for the Merged Mesh vegetation under their respective parent geometry as shown here:
Pic7: Export ready scene hierarchy
We have now finished the setup for the Maya portion of the tutorial. To continue, move to the next page where we configure the material and use the Vegetation Tool to place down some of these Merged Mesh assets.