Henko's picture

Ground mesh

First I'm going to create the ground mesh. It is not a height map. It has different textures and lots of vertices. I need to group them by texture and create the appropriate index buffers for each. I'm also going to create a special quad tree of index buffer parts to the same vertex buffer. The ground parts will be culled that are outside the camera frustum. This trick needs proper management to be quick to build and quick to render with the fewest draw calls possible.

I need to discover how to create vertex and index buffers. I will also need axis aligned bounding boxes and camera frustum intersection. I hope these are all supported in OpenTK.

I will also need to load textures and a proper shader for the ground.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Tal's picture

Don't sure if you meant you don't know how to use vertex and index buffers, or you need help with the specific case.
If you meant to the former, openecho wrote a good start for VBO&IBO :

Henko's picture

Well, I'm not sure how to construct them with OpenTK yet, because I used XNA before. But thanks anyway.

Tal's picture

I have the same story as you.... Not that I'm a pro, still a noob. You will realize by the time how great OpenGL than DirectX, but this is doesn't matter now.
Here is an easier example(VBO&IBO cube): http://www.opentk.com/node/2302
And about the second question, you will need to set them manually(the frustum) because OpenTK is "just" a wrapper(plus contain other tools) for OpenGL. There is a lot example for it, just calculate weather the position of the camera(which you will also need to set manually) is inside the bound.
In General, DirectX is nothing(yes I mean it) but Microsoft product which try to kill OpenGL. They deal with the same graphic card, so they use the same concept(so it easier than what you thought), in a different names and language.