简体   繁体   中英

GL_LINE_STRIP - Using Textures ? iOS GLKit

Is it possible in OpenGL ES 2.0 to use GL_LINE_STRIP to draw a shape and then apply a texture to that shape ?

Eg if I draw a triangle can I then apply a triangle texture ?

GL_LINE_STRIP draws only lines. If you want polygons filled in (whether with color, lighting, or texturing), you need one of the solid polygon modes: GL_TRIANGLES , GL_TRIANGLE_STRIP , or GL_TRIANGLE_FAN .

If you want to both fill and stroke your polygons, you'll need two draw calls, one with each mode. And if you're using depth testing, you'll probably want to look into glPolygonOffset to avoid z-fighting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM