MinieExamples/src/main/java/jme3utilities/minie/test/TrackDemo.java
/**
     * Add lighting and shadows to the scene.
     */
Add lighting and shadows to the scene.
Add lighting and shadows to the scene .
private void addLighting() {
        ColorRGBA ambientColor = new ColorRGBA(0.2f, 0.2f, 0.2f, 1f);
        AmbientLight ambient = new AmbientLight(ambientColor);
        rootNode.addLight(ambient);
        ambient.setName("ambient");
        Vector3f direction = new Vector3f(1f, -2f, -2f).normalizeLocal();
        DirectionalLight sun = new DirectionalLight(direction);
        rootNode.addLight(sun);
        sun.setName("sun");
        int mapSize = 2_048; 
        int numSplits = 3;
        DirectionalLightShadowRenderer dlsr
                = new DirectionalLightShadowRenderer(assetManager, mapSize,
                        numSplits);
        dlsr.setLight(sun);
        dlsr.setShadowIntensity(0.5f);
        viewPort.addProcessor(dlsr);
    }
private void addLighting ( ) { ColorRGBA ambientColor = new ColorRGBA ( 0.2f , 0.2f , 0.2f , 1f ) ; AmbientLight ambient = new AmbientLight ( ambientColor ) ; rootNode . addLight ( ambient ) ; ambient . setName ( "ambient" ) ; Vector3f direction = new Vector3f ( 1f , - 2f , - 2f ) . normalizeLocal ( ) ; DirectionalLight sun = new DirectionalLight ( direction ) ; rootNode . addLight ( sun ) ; sun . setName ( "sun" ) ; int mapSize = 2_048 ; int numSplits = 3 ; DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer ( assetManager , mapSize , numSplits ) ; dlsr . setLight ( sun ) ; dlsr . setShadowIntensity ( 0.5f ) ; viewPort . addProcessor ( dlsr ) ; }
Add lighting and shadows to the scene.
Add lighting and shadows to the scene .
// in pixels