Results 1 to 2 of 2

Thread: Blending Bitmap Fonts, Retain Antialiasing?

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    7

    Blending Bitmap Fonts, Retain Antialiasing?

    Hi,

    I prerendered some fonts with the angelcode font tool.

    To Blend against a chosen colour (in this example white) I use the following code:

    Code :
    gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
    gl.enable(gl.BLEND);
     
    gl.useProgram(TshaderProgram);
    gl.uniform4f(TshaderProgram.colorUniform, 1, 1, 1, 0.5);

    My Fragmentshader:
    Code :
    uniform vec4 uColor; //is TshaderProgram.colorUniform
     
    void main(void) {
    gl_FragColor = textureColor * uColor;
    }

    The Problem is that my original generated texture font has a smooth transition from the outlines of the single chars to the center of each char, meaning the chars are antialiased. With my implementation of the blending I lose that, meaning the antialiased soft grey areas in the charakter will simply be converted to white. So now the font in my program has ugly edges. What am I doing wrong here?

    Best regards, S.

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Blending Bitmap Fonts, Retain Antialiasing?

    What texture format are you using?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Similar Threads

  1. OpenCL Spec: release/retain errors
    By guillona in forum OpenCL
    Replies: 0
    Last Post: 01-17-2011, 07:11 PM
  2. Fonts in opengl es ?
    By gautam in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 10-21-2004, 09:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •