Jump to content

  • Log In with Google      Sign In   
  • Create Account


Backface culling


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 PH-Neutre   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 May 2000 - 11:36 PM

hi, what exactly is backface culling, and how to implemente it with OpenGL ? Thanks in advance, PH.

Sponsor:

#2 Ingenu   Members   -  Reputation: 807

Like
Likes
Like

Posted 04 May 2000 - 11:54 PM

Backface culling is to suppress the backfaces polygons.
Backfacing polygons are pols that are not facing you, that''s the ones that you don''t need to render.

Imagine a plane.
It''s define by 2 quads, one for each face.
Do you really want to compute vertex lighting, mapping... on the side you don''t see ?
No, so you do backface culling.

OpenGL (as well as Direct3D) did it for you I think you must activate it (if it''s not the default value) with the glEnable() command.

Notice that OpenGL (and Direct3D) are doing backface 2D culling at the end of the process (just before displaying), you can save extra operations by doing 3D culling using surface normals before the projection as been computed.

In 3d gfx (like anywhere) you must suppress as much stuff as you can as soon as possible.

Hope it helps.

-* Sounds, music and story makes the difference between good and great games *-

#3 Morgan   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 May 2000 - 02:37 PM

The actual code to do this is:

glCullFace( GL_BACK );
glEnable( GL_CULL_FACE );

Remember that the vertices of your triangles, polygons, etc, must entered counter-clockwise for it to work correctly;

Morgan

#4 PH-Neutre   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 May 2000 - 01:09 AM

Thanks a lot, Ingenu and Morgan !
It helps me a lot.

PH.

#5 MadKeithV   Moderators   -  Reputation: 971

Like
Likes
Like

Posted 07 May 2000 - 01:14 AM

To clear up a little thing, you can actually set vertex order any way you want, and you can tell OpenGL which way will be forward.
You can set glCullFace( GL_FRONT ) , for example,
or use glFrontFace( GL_CCW ) or glFrontFace( GL_CW );

So basically, you can pick which way is forward if you want.

What morgan described is the default setting if you don''t change anything.


#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS