MinieExamples/src/main/java/jme3utilities/minie/test/DropTest.java
/**
     * Add lighting and shadows to the specified scene.
     */
Add lighting and shadows to the specified scene.
Add lighting and shadows to the specified scene .
private void addLighting(Spatial rootSpatial) {
        ColorRGBA ambientColor = new ColorRGBA(0.5f, 0.5f, 0.5f, 1f);
        AmbientLight ambient = new AmbientLight(ambientColor);
        rootSpatial.addLight(ambient);
        ambient.setName("ambient");
        ColorRGBA directColor = new ColorRGBA(0.7f, 0.7f, 0.7f, 1f);
        Vector3f direction = new Vector3f(1f, -3f, -1f).normalizeLocal();
        DirectionalLight sun = new DirectionalLight(direction, directColor);
        rootSpatial.addLight(sun);
        sun.setName("sun");
        viewPort.clearProcessors();
        int mapSize = 2_048; 
        int numSplits = 3;
        DirectionalLightShadowRenderer dlsr
                = new DirectionalLightShadowRenderer(assetManager, mapSize,
                        numSplits);
        dlsr.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
        dlsr.setEdgesThickness(5);
        dlsr.setLight(sun);
        dlsr.setShadowIntensity(0.7f);
        viewPort.addProcessor(dlsr);
    }
private void addLighting ( Spatial rootSpatial ) { ColorRGBA ambientColor = new ColorRGBA ( 0.5f , 0.5f , 0.5f , 1f ) ; AmbientLight ambient = new AmbientLight ( ambientColor ) ; rootSpatial . addLight ( ambient ) ; ambient . setName ( "ambient" ) ; ColorRGBA directColor = new ColorRGBA ( 0.7f , 0.7f , 0.7f , 1f ) ; Vector3f direction = new Vector3f ( 1f , - 3f , - 1f ) . normalizeLocal ( ) ; DirectionalLight sun = new DirectionalLight ( direction , directColor ) ; rootSpatial . addLight ( sun ) ; sun . setName ( "sun" ) ; viewPort . clearProcessors ( ) ; int mapSize = 2_048 ; int numSplits = 3 ; DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer ( assetManager , mapSize , numSplits ) ; dlsr . setEdgeFilteringMode ( EdgeFilteringMode . PCFPOISSON ) ; dlsr . setEdgesThickness ( 5 ) ; dlsr . setLight ( sun ) ; dlsr . setShadowIntensity ( 0.7f ) ; viewPort . addProcessor ( dlsr ) ; }
Add lighting and shadows to the specified scene.
Add lighting and shadows to the specified scene .
// in pixels
