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 8898301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:34:44+00:00 2026-06-15T00:34:44+00:00

I am having difficulty understanding the meaning of the first parameter in glPolygonOffset function.

  • 0

I am having difficulty understanding the meaning of the first parameter in glPolygonOffset function.

void glPolygonOffset(GLfloat  factor, GLfloat units);

The official documentation says that factor

Specifies a scale factor that is used to create a variable depth offset for each polygon.

and that

each fragment’s depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The value of the offset is factor × DZ + r × units , where DZ is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value that is guaranteed to produce a resolvable offset for a given implementation.

I understand what r and unit are. What I don’t understand is what DZ is, i.e. what is meant by the “measurement of the change in depth value to the screen area of the polygon” and why would I ever need to set factor to anything other than 0.

If i want my wireframe to be offset all I need is to add/substact a couple of units to/from the depth value, don’t I? What’s the meaning, purpose and usage example of the factor parameter (and the DZ mentioned in the document)?

  • 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-06-15T00:34:45+00:00Added an answer on June 15, 2026 at 12:34 am

    I have to admit some ignorance here, but I found this article which explains it. They say:

    To achieve a nice rendering of the highlighted solid object without visual artifacts, you can either add a positive offset to the solid object (push it away from you) or a negative offset to the wireframe (pull it towards you). The big question is: “How much offset is enough?” Unfortunately, the offset required depends upon various factors, including the depth slope of each polygon and the width of the lines in the wireframe.

    They then explain the depth slope this way:

    The depth slope is the change in z (depth) values divided by the change in either x or y coordinates, as you traverse a polygon. The depth values are in window coordinates, clamped to the range [0, 1]. To estimate the maximum depth slope of a polygon (m in the offset equation), use this formula: m = max {|delV / delS|,|delV / delT|}. (where del is a partial derivative)

    So they conclude that:

    For polygons that are parallel to the near and far clipping planes, the depth slope is zero. […] For polygons that are at a great angle to the clipping planes, the depth slope can be significantly greater than zero, and a larger offset may be needed. Small, non-zero values for factor, such as 0.75 or 1.0, are probably enough to generate distinct depth values and eliminate the unpleasant visual artifacts.

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

Sidebar

Related Questions

I'm having a bit of difficulty understanding how the python __init__ ( ) function
I am having difficulty understanding how a function can be a monad. Function (->)
Hi everyone I'm having difficulty understanding the following function structures. Could somebody walk me
I'm having difficulty understanding variable shadowing in JavaScript based on scopes. Consider this small
I am having difficulty understanding the part value : value == 0 ? How
So I am new to C# and I am having difficulty understanding out .
So I'm new to regular expressions and having difficulty understanding them. To get my
I was going through an interview question on JavaRevisited and I'm having difficulty understanding
I am new to programming and am having difficulty with understanding object lifetime /
I'm working on an ASP.NET application and I'm having difficulty in understanding why a

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.