Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Can I texture a line?

This topic is 5902 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In reality, line segments are infinitly thin. However, in OpenGL, lines can have thickness, but a solid color line is boring. Can I texture map lines with 1D/2D textures?

Share this post

Link to post
Share on other sites
Original post by ZealousElixir
Not sure about texturing, but you can stipple. You can also draw lines as quads and manually texture them, of course.

I was considering the quad idea.

Original post by Jallen
Yes, texturing works fine for lines and points.

So, would 2D textures work? I imagine 1D textures work fine, perhaps something like this:

glBegin (GL_LINES)
glVertex3fv (firstVertexCoords);
glTexCoord1f (1.0f);
glVertex3fv (secondVertexCoords);

/* ect */
glEnd ();

Share this post

Link to post
Share on other sites
Yeah, 2D textures work fine. Some old cards don''t support it (I just remember that I used to own a card which wouldn''t texture a line or fog a line either. I think it was a voodoo, though, so you''re probably safe these days )

If I had my way, I''d have all of you shot!

codeka.com - Just click it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!