DayZ:Grass-clutter modelling

From Bohemia Interactive Community
Jump to navigation Jump to search


This page is more or less in WIP state, primarily focused on documenting changes done to the clutter for DayZ (compared to state of clutter in Arma 2 public data).

What is new

  • Single-sided faces in resolution lods.
  • Wind effect simulation moved to shaders resulting in rvmat changes - introduction of a new array: plantWind[] = {local speed, stiffness, smoothness, light/dir};.
    • local speed (0-1 range) - how much is the speed of local sinusoidal swing (is later affected by global wind and perlin wind inside shader, so stronger wind makes a little faster move).
    • stiffness (0-1 range) - how much the wind affects the XZ plane move, 0 = disable wind effect completely (used on static clutter objects - for example fallen branches, rocks).
    • smoothness (0-1 range) - affects the medium detail perlin wind ("random" gusts of wind) = 0, no smooth, 1 full smooth, almost one direction of wind.
    • light/dir (two numbers):
      • Integer part is how much the wind affects lightness of grass (a little intensity changes when the grass moves more), value is from 0-100.
      • Fractional part is the medium perlin wind directionality, 1 = all directions, 0 only main global wind direction.
  • Stage3 rvmat mask texture for the wind animation (see the sample below).
  • Optional phase offset can be specified (so polyplanes swing in a bit different manner from each other) per plane by merging vertices from a plane and position them within second uv set (and specifying uvSource=tex1 in Stage3 of grass rvmat).
  • Optional shadowBias parameter in rvmat can be used to darken clutter in shadows (0-1 range).
  • Optional use of a normal map (Stage2).
  • Ability to disable coloring by satellite (see grass-clutter configuration for more info).
  • Ability to shadow clutter using global terrain normal texture (see terrain sample for more info).

Sample

You can take a look at DayZ Samples package for an example of a clutter mesh (look out for Test_Clutter folder), textures and material itself. Please note that clutter models (when grass shader is used in material) cannot be previewed in Buldozer!