ts.setTexture(textureFirst, 0);
    public void doRender(Renderer r) {        if (!useCurrentScene && spatials.size() == 0 ) {            return;        }		tRendererFirst.updateCamera();		tRendererSecond.updateCamera();                // see if we should use the current scene to bloom, or only things added to the pass.        if (useCurrentScene) {            // grab backbuffer to texture            tRendererFirst.copyBufferToTexture(textureFirst,                     DisplaySystem.getDisplaySystem().getWidth(),                     DisplaySystem.getDisplaySystem().getHeight(),                     1);        } else    		//Render scene to texture            tRendererFirst.render( spatialsRenderNode , textureFirst);		TextureState ts = (TextureState) fullScreenQuad.getRenderState(RenderState.RS_TEXTURE);		AlphaState as = (AlphaState) fullScreenQuad.getRenderState(RenderState.RS_ALPHA);		as.setEnabled(false);		//Extract intensity		extractionShader.clearUniforms();		extractionShader.setUniform("RT", 0);		extractionShader.setUniform("exposurePow", getExposurePow());		extractionShader.setUniform("exposureCutoff", getExposureCutoff());		ts.setTexture(textureFirst, 0);		fullScreenQuad.setRenderState(extractionShader);		fullScreenQuad.updateRenderState();		tRendererSecond.render(fullScreenQuad, textureSecond);		//Blur		blurShader.clearUniforms();		blurShader.setUniform("RT", 0);		blurShader.setUniform("sampleDist0", getBlurSize());		blurShader.setUniform("blurIntensityMultiplier", getBlurIntensityMultiplier());		ts.setTexture(textureSecond, 0);		fullScreenQuad.setRenderState(blurShader);		fullScreenQuad.updateRenderState();		tRendererFirst.render(fullScreenQuad, textureFirst);		//Extra blur passes		for(int i = 0; i < getNrBlurPasses() - 1; i++) {			ts.setTexture(textureFirst, 0);			fullScreenQuad.updateRenderState();			tRendererSecond.render(fullScreenQuad, textureSecond);			ts.setTexture(textureSecond, 0);			fullScreenQuad.updateRenderState();			tRendererFirst.render(fullScreenQuad, textureFirst);		}		//Final blend		ts.setTexture(textureFirst, 0);		as.setEnabled(true);		fullScreenQuad.setRenderState(finalShader);		fullScreenQuad.updateRenderState();		fullScreenQuad.onDraw(r);	}