private void updateLastFilterIndex() {
        lastFilterIndex = -1;
        for (int i = filters.size() - 1; i >= 0 && lastFilterIndex == -1; i--) {
            if (filters.get(i).isEnabled()) {
                lastFilterIndex = i;
                // The FPP is initialized, but the viewport framebuffer is the
                // original out framebuffer, so we must recover from a situation
                // where no filter was enabled. So we set the correct framebuffer
                // on the viewport.
                if(isInitialized() && viewPort.getOutputFrameBuffer()==outputBuffer){
                    setupViewPortFrameBuffer();
                }
                return;
            }
        }
        if (isInitialized() && lastFilterIndex == -1) {
            //There is no enabled filter, we restore the original framebuffer
            //to the viewport to bypass the fpp.
            viewPort.setOutputFrameBuffer(outputBuffer);
        }
    }
compute the index of the last filter to render
jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java