MinieExamples/src/main/java/jme3utilities/minie/test/BuoyDemo.java
/**
     * Add lighting and reflections to the scene.
     */
Add lighting and reflections to the scene.
Add lighting and reflections 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, -0.2f, -1f).normalizeLocal();
        DirectionalLight sun = new DirectionalLight(direction);
        rootNode.addLight(sun);
        sun.setName("sun");
        processor = new SimpleWaterProcessor(assetManager);
        viewPort.addProcessor(processor);
        processor.setLightPosition(direction.mult(1000f));
        Plane surface = new Plane(Vector3f.UNIT_Y, surfaceElevation);
        processor.setPlane(surface);
        processor.setReflectionScene(reflectiblesNode);
        /*
         * Clip everything below the surface.
         */
        processor.setReflectionClippingOffset(-0.1f);
        /*
         * Configure water and wave parameters.
         */
        float waveHeight = 0.2f;
        processor.setDistortionScale(waveHeight);
        float waterTransparency = 0.4f;
        processor.setWaterDepth(waterTransparency);
        float waveSpeed = 0.06f;
        processor.setWaveSpeed(waveSpeed);
    }
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 , - 0.2f , - 1f ) . normalizeLocal ( ) ; DirectionalLight sun = new DirectionalLight ( direction ) ; rootNode . addLight ( sun ) ; sun . setName ( "sun" ) ; processor = new SimpleWaterProcessor ( assetManager ) ; viewPort . addProcessor ( processor ) ; processor . setLightPosition ( direction . mult ( 1000f ) ) ; Plane surface = new Plane ( Vector3f . UNIT_Y , surfaceElevation ) ; processor . setPlane ( surface ) ; processor . setReflectionScene ( reflectiblesNode ) ; /*
         * Clip everything below the surface.
         */ processor . setReflectionClippingOffset ( - 0.1f ) ; /*
         * Configure water and wave parameters.
         */ float waveHeight = 0.2f ; processor . setDistortionScale ( waveHeight ) ; float waterTransparency = 0.4f ; processor . setWaterDepth ( waterTransparency ) ; float waveSpeed = 0.06f ; processor . setWaveSpeed ( waveSpeed ) ; }
Add lighting and reflections to the scene.
Add lighting and reflections to the scene .