My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
GLSLBloom  
Piste pour l'effet de "bloom" ou de "glow" en GLSL
Updated Dec 22, 2010 by matth.ma...@gmail.com

Il semblerait que le bloom ne soit pas supporter sur toutes les cartes, j'ai cependant trouvé un code GLSL déjà tout fait qui permet de contourner ce problème, et qui, au regard des commentaires, semble plutôt bien marcher :

http://myheroics.wordpress.com/2008/09/04/glsl-bloom-shader/

uniform sampler2D bgl_RenderedTexture;

void main()
{
   vec4 sum = vec4(0);
   vec2 texcoord = vec2(gl_TexCoord[0]);
   int j;
   int i;

   for( i= -4 ;i < 4; i++)
   {
        for (j = -3; j < 3; j++)
        {
            sum += texture2D(bgl_RenderedTexture, texcoord + vec2(j, i)*0.004) * 0.25;
        }
   }

   if (texture2D(bgl_RenderedTexture, texcoord).r < 0.3)
   {
       gl_FragColor = sum*sum*0.012 + texture2D(bgl_RenderedTexture, texcoord);
   }
   else
   {
       if (texture2D(bgl_RenderedTexture, texcoord).r < 0.5)
       {
            gl_FragColor = sum*sum*0.009 + texture2D(bgl_RenderedTexture, texcoord);
       }
       else
       {
            gl_FragColor = sum*sum*0.0075 + texture2D(bgl_RenderedTexture, texcoord);
       }
   }
}

Je ne suis pas bien sûr d'avoir bien compris la technique utilisée ici, mais après une lecture rapide, ça m'a l'air pas trop mal.

Sinon, il y a aussi là : http://prideout.net/archive/bloom/index.php

Où un gentil bonhomme explique différentes technique de bloom, en détaillant bien. Voilà les pistes pour l'instant !

Comment by william....@gmail.com, Apr 25, 2012

This works great indeed, thank you for sharing, Bill

Powered by Google Project Hosting