tRendererFirst.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)); tRendererFirst.setCamera(cam);
tRenderer.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)); tRenderer.setCamera(cam); tRenderer.forceCopy(true);
	public BloomRenderPass(Camera cam, int renderScale) {		DisplaySystem display = DisplaySystem.getDisplaySystem();		resetParameters();		//Create texture renderers and rendertextures(alternating between two not to overwrite pbuffers)		tRendererFirst = display.createTextureRenderer(				display.getWidth() / renderScale, display.getHeight() / renderScale, false, true, false, false,				TextureRenderer.RENDER_TEXTURE_2D, 0);		tRendererFirst.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f));		tRendererFirst.setCamera(cam);		textureFirst = new Texture();		textureFirst.setWrap(Texture.WM_CLAMP_S_CLAMP_T);		textureFirst.setFilter(Texture.FM_LINEAR);		tRendererFirst.setupTexture(textureFirst);		tRendererSecond = display.createTextureRenderer(				display.getWidth() / renderScale, display.getHeight() / renderScale, false, true, false, false,				TextureRenderer.RENDER_TEXTURE_2D, 0);		tRendererSecond.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f));		tRendererSecond.setCamera(cam);		textureSecond = new Texture();		textureSecond.setWrap(Texture.WM_CLAMP_S_CLAMP_T);		textureSecond.setFilter(Texture.FM_LINEAR);		tRendererSecond.setupTexture(textureSecond);		//Create extract intensity shader		extractionShader = display.getRenderer().createGLSLShaderObjectsState();		if(!extractionShader.isSupported()) {			supported = false;		} else {			extractionShader.load(BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_extract.vert"),					BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_extract.frag"));			extractionShader.setEnabled(true);		}		//Create blur shader		blurShader = display.getRenderer().createGLSLShaderObjectsState();		if(!blurShader.isSupported()) {			supported = false;		} else {			blurShader.load(BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_blur.vert"),					BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_blur.frag"));			blurShader.setEnabled(true);		}		//Create final shader(basic texturing)		finalShader = display.getRenderer().createGLSLShaderObjectsState();		if(!finalShader.isSupported()) {			supported = false;		} else {			finalShader.load(BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_final.vert"),					BloomRenderPass.class.getClassLoader().getResource("com/jmex/effects/glsl/data/bloom_final.frag"));			finalShader.setEnabled(true);		}		//Create fullscreen quad		fullScreenQuad = new Quad("FullScreenQuad", display.getWidth()/4, display.getHeight()/4);		fullScreenQuad.getLocalRotation().set(0, 0, 0, 1);		fullScreenQuad.getLocalTranslation().set(display.getWidth() / 2, display.getHeight() / 2, 0);		fullScreenQuad.getLocalScale().set(1, 1, 1);		fullScreenQuad.setRenderQueueMode(Renderer.QUEUE_ORTHO);		fullScreenQuad.setCullMode(SceneElement.CULL_NEVER);		fullScreenQuad.setTextureCombineMode(TextureState.REPLACE);		fullScreenQuad.setLightCombineMode(LightState.OFF);		TextureState ts = display.getRenderer().createTextureState();		ts.setEnabled(true);		fullScreenQuad.setRenderState(ts);		AlphaState as = display.getRenderer().createAlphaState();		as.setBlendEnabled(true);		as.setSrcFunction(AlphaState.SB_ONE);		as.setDstFunction(AlphaState.DB_ONE);		as.setEnabled(true);		fullScreenQuad.setRenderState(as);		fullScreenQuad.updateRenderState();		fullScreenQuad.updateGeometricState(0.0f, true);	}