I'm new to OpenGL, and I found out that OpenGL ES doesn't support APIs such as glPolygonMode( GL_BACK, GL_FILL);
Any ideas how to implement it?
In OpenGL ES, GL_FILL
is the only available polygon mode. If you want to draw points or lines on edges then you need to upload your geometry directly for GL_POINTS, GL_LINES, GL_LINE_LOOP or whatever else is convenient. Of course, that means unpacking the more implicit triangle description modes, line strips and fans, in software for yourself, but the relevant code flows directly from the man pages.
There's no direct way to dictate whether line or point drawing will occur based on a triangle front/back facing test elsewhere. If you're in ES 2.x then you can get close to simulating the same thing by doing the triangle test you want in your geometry shader and setting a suitable flag for your fragment shader, but you'll end up duplicating the hardware test.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With