Time for action – splat goes the texture

You see how easy it is to create and texture a terrain in the SDK—but you can of course achieve the same with hand-drawn textures and hand-written Java code.

First, we create a heightmap for our terrain by performing the following steps:

  1. Create a grayscale PNG image in a graphic editor of your choice. The size must be a square power of two; for example, 512 px x 512 px.
  2. Use a spray or brush tool to outline the terrain's elevation in grayscales, where white represents high and black low.
  3. Save the heightmap as assets/Textures/Terrain/heightmap.png.

Next, we draw the alphamap that specifies where the grass, rock, and road textures go.

  1. Create an empty 32-bit RGBA color image. The size must be a square power of two; ...

Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.