CS 491 Lecture 4 – Terrain
TODO
- For Tuesday, watch Lesson 2 and Lesson 3 of the Blender 3D Design Course. Again, feel free to speed these up with a browser plugin.
- For a participation point, start with a simple cube and create something interesting by manipulating it in edit mode using any of the tools—but no modifiers. Post an image of your model on the course blog using categories
gamedev3
,spring 2016
, andgallery
.
Lab
Today we’re going to make a terrain, replete with walking paths, vegetation, and teleporters!
- Add a terrain game object.
- Use the Raise/Lower Terrain tool to sculpt your landscape. Keep this general design principle in mind: start with the large, coarse features. Only after these features are roughed out should you focus on fine details. Which brushes are appropriate for the coarse features? Which for the fine?What role does a brush’s opacity setting play? How does one lower terrain instead of raise it?
- Add an
FPSController
to your scene and playtest. - Getting the player’s vertical position can be tricky. If you set it too high above the terrain, it will briefly fall before it collides with the terrain. If it’s too low, it will fall forever in the Neath. To position an object (a player controller or other game objects) exactly on the terrain, click on the Translate tool (W on the keyboard), and Command/Control-Shift-Drag on the gray cube at the center of the translate manipulator.
- Add some texture to your terrain. The first texture you add using the Paint Texture tool is the base texture that’s applied everywhere automatically. Try adding some random images (of animals, David Bowie, etc.) as the base texture. What must be true of this base texture in order for it look believable?
- Let’s add a more realistic texture. Import everything in the Environment assets package. Replace your base texture with one of the imported ones.
- Create a multi-tier plateau somewhere in your landscape. What tool makes this easy?
- Steep elevation changes tend to distort textures. Your plateau probably demonstrates this. Argue with your partner why this is the case. Which terrain tool can help soften these distortions?
- Paint a walking path for your player. Add a second texture that seems appropriate for a walking path.
- Add trees to your scene.
- Add a wind zone to your scene. Make the wind gentle. The default settings are usually too powerful for anything but a hurricane.
- Add grass.
- Carve out a sunken area and add some water. Size it so the edges of the invoking geometry cannot be seen.
- Add a teleporter using a vertical cylinder. Make it spin forever. What component makes this easy? Add a material with an albedo texture that you create using an image editor. Give the texture an interesting pattern in the RGB channels, but mask out portions of it in the alpha channel to give it a ghosted quality. Apply this material to cylinder. Try out the material’s different Rendering Modes to see which gives the best effect. Disable shadow casting.
- Make a second teleporter like the first. But don’t Duplicate! Duplicate makes an independent copy. If you need to change something about the teleporters, you’ll have to change each individually. Instead, drag the teleporter from the hierarchy into the project assets. This makes it a prefab—a template or class that can be instanced many times. Changes made to the prefab automatically propagate to the instances.
- This last step is underspecified. When the user enters one teleporter, have it move the user automatically to the other. How can you do this? You’ll probably want a
TeleporterController
script. Give it a publicTransform
in which you can drop the matching teleporter game object. When the player enters the teleporter (OnTriggerEnter
), move the player to the matching teleporter.