SlideShare utilise les cookies pour améliorer les fonctionnalités et les performances, et également pour vous montrer des publicités pertinentes. Si vous continuez à naviguer sur ce site, vous acceptez l’utilisation de cookies. Consultez nos Conditions d’utilisation et notre Politique de confidentialité.
SlideShare utilise les cookies pour améliorer les fonctionnalités et les performances, et également pour vous montrer des publicités pertinentes. Si vous continuez à naviguer sur ce site, vous acceptez l’utilisation de cookies. Consultez notre Politique de confidentialité et nos Conditions d’utilisation pour en savoir plus.
Visit the original blog post at http://fragileearthstudios.com/2012/09/15/generating-complex-terrains/ for additional information and sample files. Forget what you know about editing terrains. Unlike the terrain editor in Unity that functions like a paint program, World Machine (and programs like it) operate on a procedural level. A World Machine world file is not the terrain, but the steps that creates the terrain. This is the source of both its power and its complexity. This presentation covers the process on how to use World Machine in conjunction with Unity3D to generate realistic looking terrains for your scene.
Forget what you know about editing terrains. Unlike many other terrain editors that function like paint programs, World Machine operates on a procedural level. A World Machine world file is not the terrain, but the steps that creates the terrain. This is the source of both its power and its complexity.This is the included sample file. Note the collection of devices which ultimately generate our terrain and associated bit maps.A free for non-commercial use version of World Machine is available for windows download at: http://world-machine.com/download.php
A device has Ports. A port is simply a place where terrain data can move in or out of a device. These can be divided into two main categories: inputs and outputs. Inputs are on the left side of the device, and bring data into a device to be acted on. After the action of the device takes place, the data is then taken out of the device via an output, on the right side. Lastly, some devices have a mask input port, which allows you to control the device's area of influence.There is one other type of port in World Machine, called a parameter port. These are located along the top edge of the device, and allow advanced users to adjust the settings of a device from a different one.
Green generates terrainBlue generates distribution mapsRed saves the output files
The devices used to generate the sample terrain height field. Distribution maps come later in the process.
This device is a highly customizable fractal terrain generator based upon the basic fractal noise techniques pioneered by Ken Perlin. http://www.world-machine.com/DeviceRef.html#APRL
Spherical: A sphere-shaped profile that falls off steeply at the edges.Gaussian: A mound-shaped profile that follows a gaussian distribution.Diamond: A constantly sloped profile that looks much like a pyramid.Square: A square profile. It stays level until dropping sharply at the edges to zero.Cone: Constantly slopes downward to zero in all directions.
Average: Average the two terrains together; the strength parameter controls the weighting of the average.Add: Add the 2nd terrain to the 1st. The strength control adjusts the amount of addition.Subtract: Subtract the 2nd terrain from the 1st. The strength control adjusts the amount of subtraction.Multiply: Multiply the terrains together. The strength control blends from none to full multiplication.Max: Use the tallest height of either terrain at each point.Min: Use the lowest height of either terrain at each point.Power: Exponentiate the 1st terrain with varying power based upon the 2nd.Root: Take the root of the 1st terrain with varying power based upon the 2nd. Values in the second heightfield above 0.5 are added to the first; if they're below that, they're subtracted.
Refer to chapter 5 in the world machine users manual for more information on the layout generator.
It is well worth your time to experiment either with your own settings or using one of the presets supplied with the device. Dramatically different effects and intensities of erosion can be achieved.
A heightmap or heightfield is a raster image used to store values, such as surface elevation data.
There is a controllable falloff amount that blends between the fully selected and fully-unselected areas. The slope sliders define a range of two slope. All areas with slopes between these two will be selected.Fuzziness Areas outside of the exact slope range specified will be partially selected based upon the strength of the fuzziness slider.Falloff TypeLinear: The fuzziness curve is a linear curve.Exponential: The fuzziness curve is an exponential curve (steep falloff at first, slow decay farther away).
Strength The Strength parameter determines what level of convexity maps to the largest allowable mask value.
There is a controllable falloff amount that blends between the fully selected and fully-unselected areas. Height Sliders The height sliders define a range of two heights. All heights between them will be selected.Fuzziness Areas outside of the exact height range specified will be partially selected based upon the strength of the fuzziness slider.Falloff TypeLinear: The fuzziness curve is a linear curve.Exponential: The fuzziness curve is an exponential curve (steep falloff at first, slow decay farther away).
Probability Type What kind of distribution model to use. There is currently only one option.Uniform: Use a uniform distribution to scatterthe points across the map.Bias The Bias control adjusts what value in the input map represents 50% probability of dot creation. The default is 0.5. Adjusting this will cause greater or fewer numbers of dots to be created.
The opposite of the Channel Splitter, this device can treat the three heightfields as either Red/Green/Blue or Hue/Saturation/Luminosity values.
First create a terrain, then import a height map.
Generating Complex Terrains for Unity3D
Generating Complex Terrains for Unity3D Eric Hackathorn 9/10/2012 Terrain by Vincent Ferrand
Preparation Download material from the classroom web site You should be done with this!
The World Machine Device Program Variables InputsWorld Machine operates Outputson a procedural level. AWorld Machine world fileis not the terrain, but thesteps that creates theterrain. Input Mask http://world-machine.com/learn.php
PerlinPerlin Noise works by layering the output ofseveral sets of noise together. These layers arecalled octaves. The multiple octaves arecombined together in a variety of ways tocreate the final result.
Radial GradientThe Radial Gradientgenerator createsshapes that are allcentered around onepoint in space. (Ex:spherical, gaussian,diamond, square,cone.)
CombinerThe combiner combinestwo separate terrainsinto one. There are avariety of differentmethods that can beused to combine theterrains -- each will givea different effect.
LayoutA layout generator interacts with thelayout view to provide a home for a setof shapes you can use to define terrainshapes, create masks, add roads, andmore.
ErosionThe erosion filter simulates the work of thousands ormillions of years of weathering and erosion by rain,flowing water and mass movement. It is anexceptionally useful tool to add detail and realism tohuman-created terrains. There are a large number ofparameters in the Erosion device and each parametercan interact with the others to create to a uniqueeffect.
Select SlopeThe slope selector is used tocreate a mask that highlightsareas of the terrain that havea particular slope. The outputwill be full strength (white) inthose sloped areas and zerostrength (black) outside of it.
Select ConvexityThe convexity selector discovers areas of theinput terrain that are either highly exposed(convex) or recessed (concave). Convex areasare white (one), while concave areas are black(zero). Neutral areas that are neither will beneutral grey. This device can be very useful fortexturing to either to help shadow recessedcracks in the terrain, or to bring out ridges andother areas that are highly exposed.
Select HeightThe height selector is used tocreate a mask that highlightsa certain height range of theinput terrain. The output willbe full strength (white) in thatrange area and zero strength(black) outside of it.
Probability FilterThe probability filter treats the input map as aprobability density function, and creates amask that randomly scatters dots according tothat density function. It is intended to beuseful for object placement maps.
Channel Combiner The channel combiner recombines three individual height fields into a bitmap typically using the red, blue, and green channels.
Splat Map Terrain Distribution Maps Grass Distribution Tree Distribution
File TypesThe file output device saves the fully built The bitmap output allows you to export aheight field to disk. Only the height field bitmap data type to a file. You may exportinformation is saved -- any color-height to either 8 or 16bit per channel colormapping applied in World Machine is for formats.illustration only, and is lost.
Import into UnityHeight Map Splat Map Grass Map Tree MapOne small last part…
Scene SetupThe terrain paint tool is The tree placement tool is The grass and detailexpecting four textures for expecting three prefabs for placement tool isthe R, G, B, and Alpha the R, G, and B channels of expecting six grass orchannels of the splat map. the tree distribution map. detail meshes for the R, G, and B channels of the grass distribution maps.
Terrain ScriptDrag the appropriate textures into the splat map, tree distribution, and grass/detaildistribution settings in “Julien’s Terrain Tools” and hit apply.