GLGraphics update:   3 comments

This is basically a bug-fix release: an error in the assignment of values to the texture offset uniforms was corrected, and now the library is compiled with Java 1.5 as target (some people reported problems when running 0.8.9 on Processing 1.0.1 which seem to be related to the fact that 0.8.9 was compiled with 1.6 as target).

Download from here.


Posted December 4, 2008 by ac in Programming

Tagged with , , ,

3 responses to “GLGraphics update:

Subscribe to comments with RSS.

  1. Hi Andres,

    what does the fade parameter do in GLTextureFilter.apply()?

  2. It lets you fade the filtered image in and out. The idea is that if you set fade parameter to 0.0, the output of the filter should be the original image, and the filtered image when it is 1.0. Intermediate values should show a linear blending between the original and the filtered image. In fact, this behavior needs to be implemented inside the fragment shader, for instance:

    uniform sampler2D src_tex_unit0;
    uniform float fade_const;

    void main(void)
    vec4 src_color = texture2D(src_tex_unit0, gl_TexCoord[0].st);

    vec3 lum_coeff = vec3(0.299, 0.587, 0.114);
    float lum = dot(lum_coeff, src_color,rgb)
    vec4 dest_color = vec4(lum, lum, lum, 1.0);

    gl_FragColor = (1.0 - fade_const) * src_color + fade_const * dest_color;

    If the shader doesn’t use the fade_const uniform, then the fade values you pass to the GLTextureFilter.apply() method won’t have any effect.

  3. Ah, got it. I thought it would do the fade automatically without having to anything additional in the fragment shader. Thx. much.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: