0
\$\begingroup\$

I cannot work out why my blur shader based on this example affects only what's inside the illuminated sphere. Below is the loop I'm using to blur an HDR framebuffer 5 times horizontally and vertically

White disc with outer edge fading to pink against a black background

for(let i = 0; i!=5; i++){
    gl.bindFramebuffer(gl.FRAMEBUFFER,BlurFBOH);
    gl.viewport(0,0,canvas.width,canvas.height);
    gl.clearColor(0,0,0,1);
    gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);
    
    setUniformInt(BlurShader,"HV",1);

    if (iteration == 0) {
        gl.bindTexture(gl.TEXTURE_2D, HDRTex);  
    }
    else {
        gl.bindTexture(gl.TEXTURE_2D,blurredTexV);
    }
    renderQuad(BlurShader,quadVAO,ID,ID,ID);
    gl.bindFramebuffer(gl.FRAMEBUFFER,null);
    
    gl.bindFramebuffer(gl.FRAMEBUFFER,BlurFBOV);
    gl.viewport(0,0,canvas.width,canvas.height);
    gl.clearColor(0,0,0,1);
    gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);
    
    setUniformInt(BlurShader,"HV",0);
    gl.bindTexture(gl.TEXTURE_2D,blurredTexH);
    renderQuad(BlurShader,quadVAO,ID,ID,ID);
    gl.bindFramebuffer(gl.FRAMEBUFFER,null);
    iteration++;
}
\$\endgroup\$
3
  • \$\begingroup\$ Is it possible that the brightness in the center of the globe is so high that the faint glow outside gets clamped down to zero during the HDR resolve pass? Kind of like taking a photo in bright sunlight can make detail in shadowed areas disappear due to the high exposure bracket. \$\endgroup\$
    – DMGregory
    Nov 11, 2022 at 0:23
  • \$\begingroup\$ Thanks for the suggestion but I don’t see how that could be the case. The problem as you can see zoomed in is that the ages are still aliased as if no blurring has taken place which is very odd \$\endgroup\$
    – Sina Dasht
    Nov 11, 2022 at 11:46
  • \$\begingroup\$ Actually I believe you might be onto something here \$\endgroup\$
    – Sina Dasht
    Nov 11, 2022 at 11:48

0

You must log in to answer this question.

Browse other questions tagged .