LWJGL Forum

Programming => OpenGL => Topic started by: Obsyd on May 07, 2012, 20:54:19

Title: Texturing the outlines?
Post by: Obsyd on May 07, 2012, 20:54:19
Hello!

So my problem is that I would like to texture a triangle but the texture only appears inside the wireframe of the triangle. I also need to texture the wires(the outline of the triangle) that represent the triangle.
How can I do that?

Thank you!

The pink area is the picture that I get if I render the "green" triangle.  (basically its the inside of the green wire)
Title: Re: Texturing the outlines?
Post by: Simon Felix on May 07, 2012, 22:30:39
Are you just saying you want to texture a slightly bigger triangle?
Title: Re: Texturing the outlines?
Post by: Obsyd on May 07, 2012, 22:43:50
Not really.
I need to somehow texture the outlines.
I can't make the triangle bigger.

Maybe I can specify a different rasterization method?
Title: Re: Texturing the outlines?
Post by: CodeBunny on May 08, 2012, 15:26:26
These calls set rendering to be wireframe or fill mode:

glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );

glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );

If you want to render both the polygon, and render the wireframe differently, I'd suggest rendering them both in a two-pass scenario.
Title: Re: Texturing the outlines?
Post by: Obsyd on May 08, 2012, 16:52:09
Thank you CodeBunny!
It works! :)

Is there a mode where I don't need to "double" render? (I guess no)

Again,
Thanks!