public static void renderParticles() {
        List<Particle> particleList = new LinkedList<Particle>();
        for (ParticleEmitter particleEmitter : particleEmitterList) {
            particleList.addAll(particleEmitter.getParticles());
        }

        glEnable(GL_TEXTURE_2D);
        int[] currentBlendFunc = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};
        Texture currentBoundSpriteSheet = null;

        Point3f camPos = GameCamera.getPos();
        TreeMap<Float, Particle> farthestToClosestParticles = new TreeMap<Float, Particle>();
        for (Particle particle : particleList) {
            float dist = MathUtils.quickLength(camPos, particle.getPos());
            farthestToClosestParticles.put(dist, particle);
        }

        Set<Float> distanceSet = farthestToClosestParticles.descendingKeySet();
        Iterator<Float> distanceIterator = distanceSet.iterator();
        while (distanceIterator.hasNext()) {
            float nextDist = distanceIterator.next();
            Particle curParticle = farthestToClosestParticles.get(nextDist);
            int[] particleBlendFunc = curParticle.getBlendFunc();
            Texture particleTexture = curParticle.getTexture();

            if (!currentBlendFunc.equals(particleBlendFunc)) {
                glBlendFunc(particleBlendFunc[0], particleBlendFunc[1]);
                currentBlendFunc = particleBlendFunc;
            }
            if (currentBoundSpriteSheet == null || !currentBoundSpriteSheet.equals(particleTexture)) {
                particleTexture.bind();
                currentBoundSpriteSheet = particleTexture;
            }

            curParticle.render();
        }

        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glDisable(GL_TEXTURE_2D);
    }