Results 1 to 2 of 2

Thread: CULLING doesn't work always

  1. #1
    Guest

    CULLING doesn't work always

    hi !

    i am rendering different objects, each of them consisting of many polygons (in fact the polygons are only triangles, defined by GL_POLYGON).

    now i want to cull back-face-polygons, an it does work, but only for the first object !
    if i render one of the other objects with backface-culling enabled, it displays _also_ the backface polygons !

    the same happens if i want to render the front-face-polygons with GL_FILL and the back-face-polygons with GL_POINT - it works correct for the first object, but not for the other polygons.

    any idea what's wrong ?

    Hannes

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

    Re: CULLING doesn't work always

    First, if all your polygons are triangles it's much faster to use the GL_TRIANGLES primitive which can batch all these vertices together, whereas you need to call glBegin-glEnd for each GL_POLYGON primitive now.

    OpenGL is a state machine. If you have set any of the culling or polygon mode features once, as seems to be true for the first object which works, you must have reset it to something different for the other objects.

    Check your code for all occurances of glCullFace, glFrontFace, glEnable, glDisable, glPushAttrib, glPopAttrib, or different OpenGL contexts. Any of these could have an effect on culling.
    Same for glPolygonMode and different contexts.

    Oh, and make sure you have depth testing enabled and the depth buffer cleared, in case this only looks like culling is not working.

    [This message has been edited by Relic (edited 07-14-2003).]

Similar Threads

  1. second UBO doesn't work
    By mlkn_mlkn in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-11-2015, 12:34 PM
  2. It doesn't work...
    By GunCraP in forum OpenGL: User Software
    Replies: 0
    Last Post: 01-03-2003, 01:46 AM
  3. Why doesn't this work
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-11-2002, 02:25 AM
  4. Why this little program doesn't work ?
    By airseb in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 03-26-2002, 10:51 AM
  5. doublebuffer doesn't work
    By Tux in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 02-12-2002, 06:55 AM

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