Archived

This topic is now archived and is closed to further replies.

Gammastrahler

The problem with glCullFace() and specifying vertices....

Recommended Posts

hi, i´m a little bit confused about this: to speed up rendering, i use glCullFace(GL_BACK). OK. So my polys are all counter-clockwised (glFrontFace(GL_CCW). But when i want to draw a quad backface, for instance, i must swap vertex 0 and 3, or the primitive won´t be drawn. this is generally no problem, but it is inconvenient for me when i need to do some math. for example, my code to calc normals do not work properly for backface polys. i have considered to hold a specific option for every poly when it´s created, whether it is facing front or back and then either call glCullFace(GL_FRONT) or glCullFace(GL_BACK). But this seems still to inconvenient. i search for a solution which can test whether a polygon is facing back or front, even if i specify my points in the same order, and then calculate the proper normals... i hope you understand and can help me... thanks & greets gammastrahler

Share this post


Link to post
Share on other sites
quote:
Original post by Gammastrahler
to speed up rendering, i use glCullFace(GL_BACK). OK. So my polys are all counter-clockwised (glFrontFace(GL_CCW).

But when i want to draw a quad backface, for instance, i must swap vertex 0 and 3, or the primitive won´t be



If I understand the problem right can you disable culling or use glCullFace(GL_FRONT).

Share this post


Link to post
Share on other sites