Bending Setup

Overview

There are 3 different kinds of bending in CRYENGINE: Touch bending (physical movement from collision), Detail bending (physical movement from wind) and Automerged bending (uses a more physically accurate system which reacts to wind and collisions more realistically and with higher performance).

With Crysis 3 (and CRYENGINE 3.5 and beyond) we added physically correct wind bending. This gets activated by the 'AutoMerged' checkbox in the vegetation properties. This feature merges multiple meshes within several sectors in single meshes, as long as they are using the same material with the same textures.

These can all be fine tuned in the Sandbox Editor's Vegetation Tool. Detail and Touch bending can be tuned with the single Bending property in the vegetation properties, the higher the value, the stronger tree gets affected by main bending. The AutoMerged vegetation has several of its own bending properties as well. Please have a look at the Vegetation Creation article for more information on the bending value for vegetation objects.

Touch Bending

See the Touch Bending article.

Detail Bending

See the Detail Bending article.

AutoMerged Vegetation

To set a vegetation object to use the AutoMerge system, simply activate the 'AutoMerged' checkbox in the vegetation properties. You can also enable/disable rendering of the objects with e_MergedMeshes 0/1.

AutoMerged was initially implemented to reduce drawcalls while keeping the flexibility to paint grass objects on any surface without being restricted to larger grass patches. The 'Fit to Terrain' or 'AlignToTerrain' features are not necessary while this is activated because you're no longer dealing with large grass patches. You can paint single grass blade objects on the terrain as well as on brushes in different heights independently, while they get merged by the engine into larger chunks in real-time. It merges multiple meshes within several sectors as long as they are using the same material with the same textures. It's useful to keep the amount of different materials for merged meshes as low as possible, to keep the memory usage low for console systems.

With this feature we added a physically correct wind bending too. The main bending values are ignored while AutoMerge is active. The AutoMerged physics are getting their movement from the current environment wind setting in the level and their Stiffness, Damping, Variance and Air Resistance settings in the vegetation properties (they can also be affected by wind forces).

The grass blades should be as low-poly as possible for consoles to guarantee that they don't have to stream in and merge large amounts of mesh data. You can also disable vertex colors for these, while exporting to decrease the size further.

You can fine-tune performance of the AutoMerge system by tweaking the e_MergedMeshesInstanceDist CVar (default '1'). This controls the LOD distance for time-slicing the physics updates, so the lower the number, the closer and more obvious the vegetation will "stutter".

Setup in 3dsMax

The 'Automerged' grass or plants need the same setup as for Touch Bending vegetation. A Bending or Obstruct proxy is not mandatory.

Debug Commands

  • e_MergedMeshesDebug 1: Displays the merged mesh memory usage & instance count at the top right corner.
  • e_MergedMeshesDebug 2: Displays the merged mesh chunks.