Unity3D : Adding Environment Water Effects - CEMS

48 downloads 2962 Views 80KB Size Report
Unity3D : Adding Environment Water Effects. This tutorial assumes you have carried out the tutorial on creating and texturing a basic terrain: Unity 3D: Creating ...
Unity3D : Adding Environment Water Effects This tutorial assumes you have carried out the tutorial on creating and texturing a basic terrain: Unity 3D: Creating and Editing a Terrain. This activity will show you how to create an environment water feature that conveys the sense of a shoreline. 1. Start a new Unity3D project and name it WaterWorld 2. Create a new terrain. Set the terrain resolution length and width values to 1000. Create and position a directional light. Add a Hill Grass texture 3. The terrain height needs to begin at its ground level, rather than at zero, which is the default for new terrains. To create an island shoreline effect the terrain height of zero should be the sea bed, then ground level should be raised to be the surface height of the island. Select Terrain -Flatten Heightmap. 4. Click inside the Height box, and place in a value of 30 meters, and then press Enter to confirm. Click on Flatten to finish. The terrain can now be flattened around the edges using inverse Raise Height to leave a raised island in the centre of the terrain. This is a more time-efficient method than beginning with a flat island and raising the height in the centre. 5. On the Inspector for the Terrain object's Terrain (Script) component, choose the Raise Height tool—the first of the seven buttons. Select the first brush in the palette, and set its Brush Size to 75. Set Opacity for the brush to 50. Change your view in the Scene panel to a top-down view by clicking on the Y-axis of the view gizmo in the top-right 6. Using the Shift key to lower height, paint around the outline of the terrain, creating a coastline that descends to zero height—you will know it has reached zero as the terrain will flatten out at this minimum height. 7. Add an a sandy texture to the area that represents the beach 8. The Standard Assets package gives us two readymade surfaces with the

water material applied. Readily saved as prefabs, these objects can be introduced easily from the Project Panel. Simply open the Standard Assets - Water folder. Drag the Daylight Simple Water prefab into the scene and position it at (500, 4, 500) by filling in the X, Y and Z values for Position in the Transform component in the Inspector.

Unity3D : Adding Environment Water Effects In order to expand the scale of the water prefab to form a sea around the island, increase both the X and Z values under Scale to 1600. This places the water in the center of the map and four meters above the sea bed. This will cover up the corners the island, and mask the terrain's true square-based nature. 8. Create a First Person Controller in the scene and explore your world. 9. Using the terrain sculpting tools, try cerating some inland water features – e.g pools, streams by reducing the ground height to reveal the water below. 10. Try adding a water effect to the world you created in the Creating and Editing a Terrain tutorial.