Using Bump Map

Bump Map uses colors in the image to imitate small displacement on the surface of a 3D object. It's a great way to add small texture details to 3D objects. It saves you the great effort of describing them in 3D terminology.

For example, take a look at the next bump map image and the 3D object affected by it:

 

To achieve that, you need to call material.setBumpMap(Image bumpImage):

PhongMaterial material= new PhongMaterial();material.setBumpMap(new Image(            "https://upload.wikimedia.org/wikipedia/commons/8/86/IntP_Brick_NormalMap.png"));Box box = new Box(100, 100, 100);box.setTranslateX(250);box.setTranslateY(100);box.setTranslateZ(400); ...

Get Mastering JavaFX 10 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.