Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4108830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:42:40+00:00 2026-05-20T21:42:40+00:00

Please take a look at this: https://i.stack.imgur.com/9UOhU.jpg The problem: The grid is drawn perfectly

  • 0

Please take a look at this:
https://i.stack.imgur.com/9UOhU.jpg

The problem:

The grid is drawn perfectly fine without fog. When fog is enabled, the vertical lines disappear. I then rotate a little to the left and and all lines start to get invisible; if I had rotated even more, they would completely disappear. It seems that it depends on the viewing angle. I thought it could be a problem with the lighting but I turned that off and the result was the same.

I also tried different fog types but the results were the same. If I look straight down (90º angle with the grid plane) I can clearly see all the grid lines.

What’s pup with this behavior? Can it be fixed?

The code is very basic but here it is in case it’s important:

main():

glEnable(GL_FOG);
glHint(GL_FOG_HINT, GL_NICEST);

renderScene():

float fogColor[3] = {0.8f, 0.8f, 0.8f};
glFogfv(GL_FOG_COLOR, fogColor);
glFogi(GL_FOG_MODE, GL_EXP2);
glFogf(GL_FOG_DENSITY, 0.01f);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:42:41+00:00Added an answer on May 20, 2026 at 9:42 pm

    Without knowing more about the way the lines are drawn, I’m going to assume that you’re drawing a single line for each horizontal and vertical line on the grid. The Fog equations are evaluated at vertices only, so if your only vertices are at the very ends of the lines, you’ll end up with peculiar artefacts, such as the ones you are seeing.

    The main way to solve this is to introduce more vertices; build a vertex for every crossing point, and connect each one up to make your grid. This will result in many more lines and vertices, but you’ll get the correct behavior.

    I’ll go into more detail below to help explain the concept of aliasing, which is what you’re most likely seeing.

    Remember that any values evaluated at vertices (such as vertex colors, normals, texture coordinates), will be interpolated linearly to cover the triangle/line in between them. Imagine a case where we want pixels in the center of the screen to be bright, and edge pixels to be dark. (A strictly theoretical case, but useful for explanation). Say we draw a line from one edge, through the middle, and to the other edge. Say we only do this with 2 vertices, one at each edge. We then calculate the brightness of both these vertices to be dark. Then, to draw the line, OpenGL interpolates between dark and dark to determine the color of the line. There’s no way for the line to know it needs to be bright in the center.

    So, if you add a vertex in the center, it would now calculate that the center is bright. The more vertices you add, the more accurate the brightness becomes.

    Good luck and Have fun. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please take a look at this site as a reference: http://www.philsalesses.com/place-pulse/ On the left
could you take a look at this http://jsbin.com/osolo/ please? If you enter a letter
Please take a look at this image: alt text http://a.imageshack.us/img21/6190/64635037.png I have a MDI
Please take a look at this: protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int
Please take a look at this spider example in Scrapy documentation. The explanation is:
Please take a look at this navigation: http://beta.viewcms.info/mint/ And you can see the hover
please take a look at the blue menu bar at the top of http://www.animefushigi.com
hi, i am not sharing code. the problem is in this code please take
Look, this is my test site. http://www.securebitcr.com/test/balls.php The problem that I am having is,
Please take a look at http://jumardirectsites.com/_dev/kabnick/ using Internet Explorer. When the slides fade, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.