2

Let's say I enable backface culling using:

glEnable(GL_CULL_FACE);

I can configure which side faces are culled on using either of these:

glFrontFace(GL_CW);
glFrontFace(GL_CCW);

Is there a significant performance difference if I choose one over the other?

My hunch says it doesn't matter because this should only involve checking against a different sign when taking the scalar product. Though perhaps this is hardware dependent too?

Bartvbl
  • 2,878
  • 3
  • 28
  • 45

2 Answers2

1

These functions are not linked to performance directly. It depends on how you define your mesh and these function are only information to culling functions to decide which winding to ignore. So it should not matter performance in anyway.

codetiger
  • 2,650
  • 20
  • 37
  • Indeed they are. I'm more curious about the rendering process that occurs when rendering the meshes either using one order or the other. It's true that rendering performance is dependent on a lot of different factors, but say you are rendering a scene where exactly half of the triangles is facing to the camera, and the other half away. Would it in that case matter whether you choose to define your faces in clockwise or counter-clockwise order? – Bartvbl Sep 19 '16 at 13:44
  • Based on the some opensource implementation (Mesa3d) of software based renders, the performance does not differ. – codetiger Sep 19 '16 at 15:52
0

As far as the OpenGL specification is concerned, there's nothing defined about exact runtime behavior, which included performance. Behaviour like this always depends on the implementation at hand. However I know of no implementation in particular where there would be a measureable difference.

datenwolf
  • 159,371
  • 13
  • 185
  • 298