Terrain chunks and index arrays

Started by
26 comments, last by rethan 14 years, 11 months ago
Haha, true!

It's getting better (even without skipping):

Advertisement
Not to add to the confusion, but be sure you are clear what m_patchSize means. It looks like you have the "fence post" problem in your numbering of verts in the "starting base grid" picture (left-most one).

If those numbers are the verts, then your base grid is missing another vert number. If you want 16 total verts per side, then you will end up with 15 total squares per side. If you want 16 total squares, you will then need 17 total verts per size of the grid. The grid you show as 16x16 actually has 17x17 verts per side. In this case, your patches would need to store 9x9 verts in order to have 8x8 squares.

Perhaps you should rename m_patchSize to something that is more telling like m_patchNumVerts or m_patchNumSquares so it is clear since "size" is ambiguous in this case.
Also, do GetWidth() and GetHeight() return the number of squares per side or number of verts per side? I would also rename these to be more explicit like GetWidthNumSquares() or GetWidthNumVerts().
Yay! Finally solved it now! Fixed the indice creation once again and the base grid is now (n+1)^2. Thanks to everybody! I'll post the code tomorrow if you're interested:)
Nice! Don't forget a screenshot too :)
:)

1024x1024 terrain (patches which lay in far distance and out of frustum are culled out)

looks great =)
Looking sweet, nice trees too :)

This topic is closed to new replies.

Advertisement