Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eriq Muhammad Adams J. Informatics Engineering University of Brawijaya.

Similar presentations


Presentation on theme: "Eriq Muhammad Adams J. Informatics Engineering University of Brawijaya."— Presentation transcript:

1 Eriq Muhammad Adams J. eriq.adams@ub.ac.id Informatics Engineering University of Brawijaya

2  Terrain  Particle Systems  2D Filter Effect  Demo Agenda

3  Steps to create terrain :  Create heightmap  Create terrain textures  Generate Terrain  Optimize generated terrain Terrain

4  Heightmaps are an efficient way of representing the shape of a hilly landscape. Low values (e.g. 0 or 50) are valeys. High values (e.g. 200, 255) are hills. Terrain (cont.)

5  Heightmap to Terrain Terrain (cont.)

6  Heightmap File :  The size must be square and a power of two  Examples: 128×128, 256×256, 512×512, 1024×1024  Color mode: 255 grayscales.  If you supply a color image, it will be converted to grayscale (with possibly weird results).  Save it as a normal.jpg or.png file Terrain (cont.)

7  Step to create HeightMap :  Create a Texture object  Load your prepared heightmap texture into the texture object  Create an AbstractHeightmap object from an ImageBasedHeightMap. ImageBasedHeightMap expects the following parameters:  An ImageToAwt.convert()ed image file  A boolean whether you are using 16 bit – here false.  A boolean whether you are using an alphamap – here true.  Load the heightmap. Terrain (cont.)

8  Heightmap code : Terrain (cont.)

9  Texture splatting allows you create a custom textured material and “paint” on it.  Steps in creating terrain textures :  Create texture splatting by layering textures  Painting the texture by creating alpha map Terrain (cont.)

10  Steps in creating Alpha Map : 1.Make a copy of your terrains heightmap, mountains512.png, so you know the shape of the landscape. 2.Name the copy alphamap.png. 3.Open alphamap.png in a graphic editor and switch the image mode to color image. I.Paint the black valleys in the image red – this will be the grass. II.Paint the white hills in shades of green – this will be the dirt of the mountains. III.Paint blue lines where you want roads to cross the landscape. Terrain (cont.)

11

12  Terrain texturing code Terrain (cont.)

13  Optimize generated terrain  JME3 includes an optimization that adjusts the level of detail of the rendered terrain depending on how close or far the camera is. Terrain (cont.)

14  Please see example in HelloTerrain.java Terrain (cont.)

15  You can get particle effect by use ParticleEmitter class. Particle Systems

16  Steps to create particle effect :  Create emitter  Create emitter texture  Configure Emitter Particle Systems (cont.)

17 Emitter setting

18  Example code : Particle Systems (cont.)

19  Please see example in HelloEffects.java Particle Systems (cont.)

20  Light Scattering (TestLightScattering.java)  Depth of Field Blur (TestDepthOfField.java)  Toon Effect (TestCartoonEdge.java, TestTransparentCartoonEdge)  Bloom (TestBloom.java)  Fog (TestFog.java) 2D Filter Effect

21  Avalaible in TerrainDemo.zipTerrainDemo.zip Demo


Download ppt "Eriq Muhammad Adams J. Informatics Engineering University of Brawijaya."

Similar presentations


Ads by Google