Shader not working

Hi there,
I am making glow effect, but the blur shaders don’t work.
My code is this:

const hblur = new ShaderPass(HorizontalBlurShader);
const vblur = new ShaderPass(VerticalBlurShader);

var bluriness = 3;

hblur.uniforms["h"].value = bluriness / SCREEN_WIDTH;
vblur.uniforms["v"].value = bluriness / SCREEN_HEIGHT;

var renderModelGlow = new RenderPass(glowscene, camera);
const glowcomposer = new EffectComposer(renderer, renderTargetGlow);

glowcomposer.addPass(renderModelGlow);
glowcomposer.addPass(hblur);
glowcomposer.addPass(vblur);
const finalshader = {
	uniforms: {
		tDiffuse: { type: "t", value: 0, texture: null },
		tGlow: { type: "t", value: glowcomposer.renderTarget2, texture: null }
	},

	vertexShader: [
		"varying vec2 vUv;",

		"void main() {",

		"vUv = vec2( uv.x, uv.y );",
		"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

		"}"
	].join("\n"),

	fragmentShader: [
		"uniform sampler2D tDiffuse;",
		"uniform sampler2D tGlow;",

		"varying vec2 vUv;",

		"void main() {",

		"vec4 texel = texture2D( tDiffuse, vUv );",
		"vec4 glow = texture2D( tGlow, vUv );",
		"gl_FragColor = texel + vec4(0.5, 0.75, 1.0, 1.0) * glow * 2.0;",

		"}"
	].join("\n")
};
var renderModel = new RenderPass(scene, camera);
var finalPass = new ShaderPass(finalshader);
finalPass.needsSwap = true;
finalPass.renderToScreen = true;
const renderTarget = new THREE.WebGLRenderTarget(SCREEN_WIDTH, SCREEN_HEIGHT, renderTargetParameters);
const finalcomposer = new EffectComposer(renderer, renderTarget);
finalcomposer.addPass(renderModel);
finalcomposer.addPass(finalPass);
glowcomposer.render();
finalcomposer.render();

Can you help me?

The blur shaders actually work fine, see https://jsfiddle.net/gpz5a40w/1/

On what algorithm is your glow effect based on? Do you mind sharing a reference?

Yes, they are working, when they are directly rendered, but when I use them as shader input, they don’t work.

It is not intended that you do this. The render target properties are meant to be internal since the composer is constantly swapping targets. Meaning they change their role as read or write buffers.

I suggest you encapsulate your logic similar to SSAOPass. You need to maintain a beauty render target that you can use to produce the blur and afterwards the glow.

I tried using renderTarget that I put as 2nd parametr to the effect composer constructor and the hblur is ok, but the vblur still doesn’t work,