Does anyone know a simple way to specify the draw order of faces for a collada model? For instance, if I want all faces with a higher Y value to render first and then ones with a lower Y value to render last, is there some way to do this?
Maybe a custom vertex program would work? What are you trying to do?
I considered this but I’m not sure there’s any good way to do this efficiently since I don’t think there’s any way to access the face info from a Collada model. I know @Mathias_Westerdahl had mentioned that changing the winding order could help with cases like these but I’m unsure of how to modify that and Google search doesn’t turn up anything useful for any of the modeling tools I use. I run into these kinds of issues quite a lot since I have a tilted perspective which makes the order of faces ideally have to be rendered from from low Z to high Z and then high Y to low Y. I’m fairly certain that Z-testing for OpenGL is dependent on the projection used however, so I’m surprised that given that projection the order isn’t determinable already.
EDIT: I found an article which describes the issue more: https://learnopengl.com/Advanced-OpenGL/Face-culling It sounds like I would need something like “glFrontFace(GL_CCW);” which specifies a counter-clockwise or GL_CW which is a clockwise preference for front facing faces. However, my example isn’t quite as clear cut since I don’t want the far face to be culled, but instead I want the closer face to overlap it.