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,450

    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

Similar Threads

  1. outline font not showing up
    By p.apaya in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-06-2012, 09:17 AM
  2. Antialiasing for Outline Font
    By michalsz in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 03-08-2011, 11:25 AM
  3. FTGL Fill & Outline font
    By thibault in forum OpenGL: General
    Replies: 4
    Last Post: 01-22-2009, 01:47 PM
  4. Can you use Outline font in 2d environment?
    By skyeyes in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 05-19-2008, 11:30 AM
  5. Problem with outline font
    By cyam95 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-29-2001, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean