Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Outline Font and FOG problem

  1. #1
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    6

    Outline Font and FOG problem

    Hi there,

    I have a Opengl program that makes use of Outline Font. The problem is, whenever I enabled FOG, my application doesn't display my output text on screen. When I remove the 1 line - glEnable(GL_FOG);- my text seems to display ok.

    I'm just curious, is there any special function calls I need to make in order to use FOG and Outline fonts together in the same application?


    Thanks

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Outline Font and FOG problem

    That could be multiple things,
    - either something is really broken with your implementation and it really doesn't render correctly or
    - your fog setup and rendering positions are not giving the desired effect. Enabling fog is not all there is to do nice fog. You need to set the fog mode, start and end, resp. density values. EXP and EXP2 fog mode density values need to be handled carefully. Tiny changes can have a big impact.
    - Fog also only works right if you do not put any "camera" methods into the projection matrix. Camera stuff belongs into the modelview matrix or fog will be wrong.

    Try if setting the clear color to something different than the fog color show some fonts rendered fully fogged.

    If not, provide your matrix and fog setup code while rendering the font so that we can look at what you're doing.

  3. #3
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    6

    Re: Outline Font and FOG problem

    Hi there Relic,

    I've now solved this problem. The problem came from my usage of glEnable/glDisable. Basically, once you enable something and have finished using it, you must disable it accordingly.

    So, my resulting code ended up as below:

    glPushMatrix();
    glDisable(GL_FOG);
    RenderFont(0.0f, 0.0f, 0.0f, m_fontListBase, "OpenGL Rocks!");
    glEnable(GL_FOG);
    glPopMatrix();


    Thanks and regards

Posting Permissions

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