I’m attempting to procedurally generate asteroids along with their textures etc.
I just got the shape to work buuuuuuuut I can’t seem to get it to have a light and dark side with directional lighting.
DirectionalLight sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
rootNode.addLight(sun);
AsteroidGeo asGeo = new AsteroidGeo(3, 12);
Geometry geom = new Geometry("Asteroid", asGeo);
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
geom.setMaterial(mat);
geom.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(geom);
All that it shows is the geometry but lit as if I was using unshaded.
Any ideas?