Posted Thursday, 12 March, 2009 - 00:55 by snocrash
You will need to draw multiple polygons, a poly cant have a hole. applying a texture is really simple in OpenGL. I recomend reading the Red book to learn openGL.
Posted Thursday, 19 March, 2009 - 17:27 by Dinberg
I'm new and having a look round :D
I was just wondering, does OpenTK support alpha blended/alpha channel textures? If so, it could work nicely to have the polygon as a simple square, and texture it with the bitmap and give the alpha channel a nice nifty hole in the middle so that on rendering it goes straight through the polygon.
Posted Thursday, 19 March, 2009 - 17:50 by the Fiddler
That's another good approach with good performance characteristics.
Fallout 3 used an even more complicated approach to simulate errosion in concrete slabs, rocks and similar rubble. I can't find the link now, but IIRC they used a pixel shader and alpha tests / texkill to discard fragments from the corners of the geometry. Relatively simple, but with great results.
In any case, OpenTK provides access to the whole OpenGL API (shaders, FBOs, everything). If there's something you can do with OpenGL, you'll be able to do it through OpenTK.
Comments
Re: Draw Pologon with hole
You will need to draw multiple polygons, a poly cant have a hole. applying a texture is really simple in OpenGL. I recomend reading the Red book to learn openGL.
http://www.glprogramming.com/red/
Good luck!
Re: Draw Pologon with hole
Also, there is also an example in OpenTK
in the directory - Source\Examples\Tutorial\Textures.cs
Re: Draw Pologon with hole
thank for your reply.
Re: Draw Polygon with hole
I'm new and having a look round :D
I was just wondering, does OpenTK support alpha blended/alpha channel textures? If so, it could work nicely to have the polygon as a simple square, and texture it with the bitmap and give the alpha channel a nice nifty hole in the middle so that on rendering it goes straight through the polygon.
Re: Draw Polygon with hole
That's another good approach with good performance characteristics.
Fallout 3 used an even more complicated approach to simulate errosion in concrete slabs, rocks and similar rubble. I can't find the link now, but IIRC they used a pixel shader and alpha tests / texkill to discard fragments from the corners of the geometry. Relatively simple, but with great results.
In any case, OpenTK provides access to the whole OpenGL API (shaders, FBOs, everything). If there's something you can do with OpenGL, you'll be able to do it through OpenTK.
Re: Draw Polygon with hole
Sounds very nice, thanks!