@Override
    public void read(JmeImporter im) throws IOException {
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        speed = ic.readFloat("speed", 1f);
        lightDirection = (Vector3f) ic.readSavable("lightDirection", new Vector3f(0, -1, 0));
        lightColor = (ColorRGBA) ic.readSavable("lightColor", ColorRGBA.White);
        waterHeight = ic.readFloat("waterHeight", 0.0f);
        waterColor = (ColorRGBA) ic.readSavable("waterColor", new ColorRGBA(0.0078f, 0.3176f, 0.5f, 1.0f));
        deepWaterColor = (ColorRGBA) ic.readSavable("deepWaterColor", new ColorRGBA(0.0039f, 0.00196f, 0.145f, 1.0f));

        colorExtinction = (Vector3f) ic.readSavable("colorExtinction", new Vector3f(5.0f, 20.0f, 30.0f));
        waterTransparency = ic.readFloat("waterTransparency", 0.1f);
        maxAmplitude = ic.readFloat("maxAmplitude", 1.5f);
        shoreHardness = ic.readFloat("shoreHardness", 0.1f);
        useFoam = ic.readBoolean("useFoam", true);

        foamIntensity = ic.readFloat("foamIntensity", 0.5f);
        foamHardness = ic.readFloat("foamHardness", 1.0f);

        foamExistence = (Vector3f) ic.readSavable("foamExistence", new Vector3f(0.45f, 4.35f, 1.5f));
        waveScale = ic.readFloat("waveScale", 0.005f);

        sunScale = ic.readFloat("sunScale", 3.0f);
        shininess = ic.readFloat("shininess", 0.7f);
        windDirection = (Vector2f) ic.readSavable("windDirection", new Vector2f(0.0f, -1.0f));
        reflectionMapSize = ic.readInt("reflectionMapSize", 512);
        useRipples = ic.readBoolean("useRipples", true);

        normalScale = ic.readFloat("normalScale", 3.0f);
        useHQShoreline = ic.readBoolean("useHQShoreline", true);

        useSpecular = ic.readBoolean("useSpecular", true);

        useRefraction = ic.readBoolean("useRefraction", true);
        refractionStrength = ic.readFloat("refractionStrength", 0.0f);
        refractionConstant = ic.readFloat("refractionConstant", 0.5f);
        reflectionDisplace = ic.readFloat("reflectionDisplace", 30f);
        underWaterFogDistance = ic.readFloat("underWaterFogDistance", 120f);
        causticsIntensity = ic.readFloat("causticsIntensity", 0.5f);

        useCaustics = ic.readBoolean("useCaustics", true);

        final TextureKey causticsTextureKey = (TextureKey) ic.readSavable("causticsTexture", null);
        final TextureKey heightTextureKey = (TextureKey) ic.readSavable("heightTexture", null);
        final TextureKey normalTextureKey = (TextureKey) ic.readSavable("normalTexture", null);
        final TextureKey foamTextureKey = (TextureKey) ic.readSavable("foamTexture", null);

        needSaveReflectionScene = ic.readBoolean("needSaveReflectionScene", false);
        reflectionScene = (Spatial) ic.readSavable("reflectionScene", null);

        final AssetManager assetManager = im.getAssetManager();

        if (causticsTextureKey != null) {
            setCausticsTexture((Texture2D) assetManager.loadTexture(causticsTextureKey));
        }
        if (heightTextureKey != null) {
            setHeightTexture((Texture2D) assetManager.loadTexture(heightTextureKey));
        }
        if (normalTextureKey != null) {
            setNormalTexture((Texture2D) assetManager.loadTexture(normalTextureKey));
        }
        if (foamTextureKey != null) {
            setFoamTexture((Texture2D) assetManager.loadTexture(foamTextureKey));
        }

        //positional attributes
        center = (Vector3f) ic.readSavable("center", null);
        radius = ic.readFloat("radius", 0f);
        int shapeType = ic.readInt("shapeType", AreaShape.Circular.ordinal());
        this.shapeType = AreaShape.values()[shapeType];
    }
@return true to try using directional light from a scene
jme3-effects/src/main/java/com/jme3/water/WaterFilter.java