Vegetation - Part 2

*To be updated


Types of Vegetation


As we discussed in Part 1 the Method 1 (Static) uses fewer SMD entries and is not recommended for wind movement. The Method 2  (Dynamic) rely on multiple SMD entries, the models are independent and is the way to go for wind movement.

Combining multiple models in one .obj  to use SMX swing will always produce bad results. As there's no individuality, the big object will have only one axis to swing.

Both Static and Dynamic can be made with a single mesh or split in multiple meshes for each vegetation bush. The Multi Mesh approach is useful to preserve the editing capabilities of the model for future edits, but it is harder for the game to run.

I recommend to keep a backup of the Multi Mesh version, or left it inside the room .udas while sideloading a SMD with Single Mesh which is lightweight. In case something require changes the .udas SMD can be used to make the edits.

In resume these are possible combinations for vegetation:

  • Static
  • Dynamic
  • Single Mesh
  • Multi Mesh
I've created a simple chart to illustrate and also compare these approaches in four aspects: The performance impact, how it stands visually, the final SMD size, and also how it can stress the engine to its limits and trigger that camera issue. 



This chart may vary depending on the situation, but considering similar vegetation placement: The Method 1 using a single mesh is the lightest of all, while the Method 2 using multiple entries and multiple meshes, although is the one with smaller size it is the heaviest to run in-game. The performance penalty from using multiple SMD entries can sometimes be higher than having a high poly single entry model, because the entries adds extra overhead.

The Dynamic Single Mesh is the only of them without a red status so if you can live with the side effects of using "Offset[3] = 0x2" to make the model double sided, it it may be the best balance considering visuals, size and performance for a new project.

Exporting the model with multiple meshes (layers) preserves the individuality and it's easier for future edits. 




The descriptions down bellow considers the import of the object number, not the model.obj:


  • SSM: Imported as big chunks of vegetation, requires manually selection to be detached and repositioned.
  • SMM: Imported as multiple layers that can be easily rotated and moved around.
  • DSM and DMM: Both of these depends on which type of edit is considered. To edit the model itself and reflect it in the whole area is very easy and strait forward. However if the goal is to make position changes, in order to fix clipping, floating issues and other stuff it can be a real nightmare.

Using this approach the model is imported as a big chunk of vegetation when using model.obj, and as a single model when importing the actual model number. So there's no easy way to reposition the models, it requires us to find which entry it is located to manually edit it.

But there's a life saver, a saved project in the 3d Software with the models numbered by entry number. This makes it a walk in the park, so for that reason I consider it easier than the SSM vegetation edits.


Single-Sided vs Double-Sided


The vegetation models can be single or double-sided, and for this last one there are two ways of achieving it.

The first consists in using single-sided model, tied to a SMX entry with "Offset[3] = 0x2". This approach is lightweight, it uses the game engine to change the way the model is rendered, disabling the culling. The performance penalty is almost negligible.

The other way involves cloning the model and flipping the polygon faces. This produces a real double-sided model, and the in-game difference is noticeable. The downside is that this model will have double the verts.

Single-sided models can use SMX "Offset[3] = 0x2" to look better, however it may not work very well with light sources, especially the flashlight. Some models can look too dark, while nearby models are fully lit.

To mitigate this models should be facing the same direction otherwise these inconsistencies will show up. But this limits the rotation possibilities when positioning it in the area.

A trick is to use ARGB, to increase the model default light, and then reduce the SMX values for light interaction. This can make the lighting more evenly distributed, with less difference between the brightest and darkest points of the model.

For double sided models we have an extra penalty in performance, but the lighting interaction is superior. The cloned mesh should be merged with the original one resulting in a single mesh model. This optimization can increase FPS and prevent the locked camera issue.

Well, these are some of the possibilities when adding vegetation to this game, I hope someone find this useful!