4.3.2 Reducing Uniformity of Trees
The vertices of trees are modified by a randomiser
function to give each tree more of an individual and
unique look (Figure 7). First, the size is uniformly
modified using a scale of 0.9 – 1.1 times the actual
size. Therefore, all the trees vary in size. Secondly,
the rotation of the tree is changed. Rotation of the x-
axis is from 0 to 360 degrees and on the y- and z-
axis the angle is between -2 and 2 degrees to make
sure that trees are not all pointing upwards and
perfectly straight. Finally, all trees have some colour
variation applied by using vertex colours. For each
tree a random greyscale colour is determined
(between RGB 100 to 255), which is then applied to
all the tree vertices. The trees are then added to the
meshbuilder class which will again make sure that
meshes are split when reaching Unity’s mesh limit,
similar to the construction of buildings. The trees
object will become a child of the terrain tile in order
to perform efficient frustum culling. When the tile
becomes invisible to the camera, so will all the trees
on top of it.
Figure 7: Trees without variation (left) and with (right).
When rendering, the fragment shader will multiply
the tree’s texture colour with the vertex colour,
giving each tree a different colour. All these steps
combined lead to a tree placement system which
creates diverse forests, while keeping the rendering
batches intact. This means that there is no
performance loss for having many randomised trees
compared to non-randomised trees.
4.3.3 Level of Detail for Trees
Unity’s own LOD system is used to reduce the
number of triangles rendered for trees that are far
away. A LOD system tries to lower the number of
rendered triangles by replacing detailed meshes with
meshes that have a lower polygon count. These
systems work, using the fact that in perspective
views, objects become smaller when distance to the
camera is increased. With properly setup LOD
levels, it is unlikely for the user to notice the
changing geometry.
For each tree type, three different meshes have
been created in 3D modelling software: A normal
“base” tree and two types of low-polygon meshes
based upon the base tree (Figure 8).
Figure 8: Two types of trees and their three LOD levels.
The simplified trees are made like this to prevent
“popping” of the geometry. Three meshbuilder
classes are used simultaneously to generate the LOD
meshes. Each tree that is placed inside the first LOD
(high detail) meshbuilder is also automatically added
to the other two mesh builders. This will
immediately create the meshes for the medium and
low-polygon trees. Unity’s LODGroup component is
then added to this object so that Unity can
automatically determine when to render which mesh
at what distance.
4.4 Infrastructure
Various types of infrastructure are visualised as
well: Most types of car roads and railways are
visualised. The 3D models of the roads are generated
using the linestrings that are available from the OSM
data. OSM provides many categories for these. The
data is specifically filtered as follows: ‘unclassified’,
‘motorway_link’, ‘road’, ‘motorway’, ‘trunk_link’,
‘primary_link’, ‘service’, ’secondary_link’,
‘tertiary_link’, ’primary’, ’secondary’, ‘tertiary’
and ’residential’. Some categories are currently
skipped (e.g. trails) because they are rather small
and do not add significant detail to the virtual world.
They might be visible on the ground layer tiles.
An important aspect of roads that requires
attention is multiple layered roads such as
intersections, tunnels and bridges. OSM data has a
solution for objects which share the same x-y
coordinates but not elevation. The attribute layer
makes it possible to distinguish these. This way 3D
roads can be constructed which are layered on top of
each other or join two different levels together, such
as intersection junctions.
The default width of the roads is 5 meters.
Additionally, width is calculated when properties are
available such as the number of lanes or if an actual
IVAPP 2017 - International Conference on Information Visualization Theory and Applications
256