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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:41:36+00:00 2026-06-01T15:41:36+00:00

I am drawing only back faces of a geometry by invoking gl.cullFace(gl.FRONT) . I

  • 0

I am drawing only back faces of a geometry by invoking gl.cullFace(gl.FRONT). I noticed that the shade of light on these surfaces is opposite to what I expect. For correct rendering, do I have to explicitly reverse the direction of surface normals on back faces, or does the OpenGL subsystem automatically do that?

EDIT: Coming to think of it, if I reverse their normals manually they will become front faces and will be culled.

  • 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-01T15:41:38+00:00Added an answer on June 1, 2026 at 3:41 pm

    OpenGL front/back detection is based on winding, not the normal. The normal vector does not have any effect on whether the polygon is considered front or back facing.

    I think what you want to do is set the GL_LIGHT_MODEL_TWO_SIDE option of glLightModel.

    GL_LIGHT_MODEL_TWO_SIDE

    params is a single integer or floating-point value that specifies
    whether one- or two-sided lighting calculations are done for polygons.
    It has no effect on the lighting calculations for points,
    lines,
    or bitmaps.
    If params is 0 (or 0.0), one-sided lighting is specified,
    and only the front material parameters are used in the
    lighting equation.
    Otherwise, two-sided lighting is specified.
    In this case, vertices of back-facing polygons are lighted
    using the back material parameters
    and have their normals reversed before the lighting equation is evaluated.
    Vertices of front-facing polygons are always lighted using the
    front material parameters,
    with no change to their normals. The initial value is 0.

    Note that this only applies to the fixed pipeline.

    ===EDIT===

    Using custom shaders (GLES2.0 or OpenGL3+), then in the fragment shader you have access to the special boolean gl_FrontFacing. To emulate two sided lighting in a shader just test for gl_FrontFacing and multiply normal by negative one if false.

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

Sidebar

Related Questions

I'm making a complex drawing using quartz based on passed in information. The only
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Modeling tool or just a visual tool for drawing. In fact I only need
Back with another question, How do i draw 4 lines in onDraw? these are
I am experiencing a problem with Swing that only occurs when the computer monitor
Whilst drawing on a SurfaceView, I'm having a problem intercepting a 'back' key press.
I read a lot about Animation pre Honeycomp, and that changes only take account
I have a MFC document/view C++ graphics application that does all its drawing to
I was a bit surprised at first that UIView 's drawing is helped by
Drawing a blank on this, and google was not helpful. Want to make 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.