Shininess is an illumination property that gives onlookers a better idea whether the surface is smooth or rough. The Lighting.j3md
material definition not only supports plain material colors but can also render specular highlights (what we colloquially call shininess) on top of the material colors.
Let's make a smooth geometry:
Make a copy of
Main.java
and name the classMaterialColorShiny.java
. Remember to also refactor the first line of themain()
method toMaterialColorShiny app = new MaterialColorShiny();
.Replace the blue cube code in the
simpleInitApp()
method with the following:Sphere sphereMesh = new Sphere(32,32, 1f); Geometry sphere1Geo = new Geometry("rough sphere", sphereMesh); Material sphere1Mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); sphere1Mat.setBoolean("UseMaterialColors",true); sphere1Mat.setColor("Ambient", ColorRGBA.Gray ); sphere1Mat.setColor("Diffuse", ColorRGBA.Cyan ); sphere1Mat.setColor("Specular", ColorRGBA...