PDA

View Full Version : patch rendering and backface culling



sajis997
10-29-2014, 03:39 AM
Hi forum,

i am rendering path primitive with the following command:



glPatchParameteri(GL_PATCH_VERTICES,16);
glBindVertexArray(mTeapotVAOID);
glDrawArrays(GL_PATCHES,0,512);


And then i do want to do the back-face culling with the following command:



glCullFace(GL_BACK);


But it is not working. I can still see the back face of the utah teapot that is rendered with patch primitive.


Any idea ?

Thanks

Dark Photon
10-29-2014, 05:45 AM
glEnable( GL_CULL_FACE )?

sajis997
10-29-2014, 02:38 PM
Thanks for the hint.

I made the necessary changes within the application and the shader as follows:



glEnable(GL_CULL_FACE);


inside the tessellation evaluation shader:



layout (quads,equal_spacing,cw) in;



Check image


http://imgur.com/5wjHEpw


As i understand the part of the handle and the spout of the teapot should be culled in the attached image. The lid should also be fully culled.

What do you think ?

I tried with ccw inside the shader and the effect is even worse. It then culls the front face.

Where should i start look into ?


Thanks

Dark Photon
10-29-2014, 05:05 PM
It's hard for me to tell anything from a wireframe without hidden surface removal. Make sure your glFrontFace is set the way you want. Also make sure that your teapot has consistent winding on the outside faces. I'd also render a solid render of the teapot with hidden surface removal and then; then go back and render a wireframe w/o hidden surface removal but with backface culling. Make sure the triangles popping in and out look like what you'd expect to see from that direction.