Polygon Rendering Modes




GLSL Hacker - Polygon Rendering Modes

OpenGL defines 3 modes for rendering a polygon: point (GL_POINT), line (GL_LINE) and solid (GL_FILL). The default polygon rendering mode is solid.

Here is how to set the polygon rendering mode with GLSL Hacker. The polygon rendering mode can be set by three functions of the gh_renderer lib:
– gh_renderer.point()
– gh_renderer.wireframe()
– gh_renderer.solid()

Let’s suppose we have a mesh torus. Here is how to render it in point and wireframe modes:

gh_renderer.point()
gh_object.render(torus)
gh_renderer.solid()


point rendering mode

gh_renderer.wireframe()
gh_object.render(torus)
gh_renderer.solid()


line rendering mode

You can play with the demo available in the code sample pack
(host_api/GLSL_Simple_OpenGL_21_32_42/demo_torus_gl2.xml).





Leave a Comment

Your email address will not be published. Required fields are marked *