Advertisement Jump to content
Sign in to follow this  

Gaussian Blur Problems[SOLVED]

This topic is 3835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok so the problem isn't so much with the Gaussian blur, i have it working just fine, the real problem comes when i run my texture, which was obtained through an FBO through a shader which picked out the brighter parts of the texture.
uniform float bloomLimit;    // minimum brightness for bloom
uniform float bloomIntensity; // how bright is the star?
uniform sampler2D sampler0;

void main(void)
    vec4 texel;
    texel =  texture2D(sampler0, gl_TexCoord[0].st);
    vec3 colour = texel.rgb;

    // bright pass: only output colors with some component >= bloomLimit

    //if X < Y then returns Y, else returns X
    //                                X                      Y
    vec3 brightColour = max(colour  - vec3(bloomLimit), vec3(0.0));

    brightColour *= bloomIntensity;

    float bright = dot(brightColour, vec3(1.0));

    bright = smoothstep(0.0, 0.5, bright);

    gl_FragColor = vec4(mix(vec3(0.0),colour , bright), 1.0);

When i run this glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F_ARB, FBOWidth, FBOHeight, 0, GL_RGB, GL_FLOAT, 0); texture through the gaussian blur using this method:
glBindTexture(GL_TEXTURE_2D, textHDR);
	glUniform2fv(offsetsLocBlur, 25, texCoordOffsets);

	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboID2);

	fboStatus = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);

		fprintf(stderr, "FBO Incomplete number 2\n");


        glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);
        glVertex2f(-1.0f, -1.0f);
        glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 1.0f);
        glVertex2f(-1.0f, 1.0f);
        glMultiTexCoord2f(GL_TEXTURE0, 1.0f, 1.0f);
        glVertex2f(1.0f, 1.0f);
        glMultiTexCoord2f(GL_TEXTURE0, 1.0f, 0.0f);
        glVertex2f(1.0f, -1.0f);

all i get is a black screen, if i change the texture base and max level to 0 the bright pass still shows up unfortunately it does no blurring. I can only be lead to think that it has something to do with being a 16bit texture, i have no idea though, i will upload a picture if i can manage to get my web space working i can post up pictures of the bright pass. But yeah main problem when the bright pass gets blurred all i get is a black screen. Thanks for any help you can offer. Turns out i wasn't generating mip maps for it...idiot [Edited by - Deftoned on July 20, 2008 8:06:29 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!