Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

VTF to do terrain rendering

This topic is 3667 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

Anyone here used VTF to do terrain rendering vs. old school methods? Would there be any speed increases from using VTF? Other than the mesh being dynamic easier I would guess with VTF, is there any other reason to use it for terrain. I know water is a good choice. Also what about taking a mesh of say 17x17 or 33x33 and load that up as VBO and use the texture array extension to load up each 33x33 chunk of the terrain as a layer for the whole terrain? Then you would only have a VBO of 33x33 vertices and a small IBO for that mesh, and reuse it over and over again to render whatever size terrain you want?

Share this post


Link to post
Share on other sites
Advertisement
The reason that I use VTF is that I can have only one vertex and index buffer and tile them. It saves on memory. Basically what you were saying in your second paragraph.

However, I tried small sizes like 17x17 and 33x33 and had hard times rendering a large mesh(4k x 4k). By making the size larger, such as 129x129, there was a large speed increase (2.5x if I remember correctly). The bottleneck seemed to be coming from the many draw calls that were needed. Remember, vbo's are optimized for rendering large numbers of triangles, nor repeatedly rendering small numbers.

Also, you can implement LOD easily by simply having more than one index buffer (one for each level). If you want to keep things simple, keep track of the adjacent patches and using the vertex shader move some of the vertices on the finer patches to make sure there are no cracks. This keeps you from making many index buffers for each level.

Hope this answers you questions.

Share this post


Link to post
Share on other sites
Hello, SO would you say the VTF method for terrain rendering is faster than using a VBO that holds say a 512x512 mesh and smaller? ANd larger meshes the VBO was faster?


Thanks

Share this post


Link to post
Share on other sites
No, I use vertex texture fetch along with a single VBO to render my terrain. The combination of the two saves memory and seems to render faster (because I can make use of really efficient LOD).

I don't really know if there is a big speedup with VTF but the fact that everything is handled in my vertex shader greatly increases the amount of flexibility i have. I don't have to ever write my vertex buffer again, so it is really efficient. VBO's that are static are heavily optimised, while dynamic VBO's are slower, if I remember correctly. So I guess you would get a speed boost from that if you were changing your mesh many times.

Oh, and I just thought of this, you could theoretically use a single terrain object to render hundreds of terrains. You just pass a texture to the render function. The vertex shader will take care of the rest for you. So even more memory efficient :)

Share this post


Link to post
Share on other sites
On the other hand you limit yourself to heightmap terrain without overhangs or caves. Did benchmark the costs of a vertex texture fetch? I guess it should be equally fast as TFs in the fragment shader due to the unified architecture

Share this post


Link to post
Share on other sites
Well in terms of overhangs or caves, what I do is replace the patch that has that feature by a 3d model. The adjacent patches automatically adapt to the LOD of the center model (it took a while to figure out how).

As far as I know, there are no terrain methods (besides voxel terrain) that allow caves.

Also, the vtf is really fast on most recent graphics cards, and even if I do lose a few fps (i haven't benchmarked, so i don't really know), the trade off in ease of use is more than worth it.

Share this post


Link to post
Share on other sites
Perhaps, but I thought that the number of triangles that could be outputted were limited because gs are slow in comparison to the other shaders. Thus making the maximum size of the caves small. Please correct me if i'm wrong.

Share this post


Link to post
Share on other sites
what about ATI and VTF, I know that newer ATI cards support VTF, but they didn't always. How common is VTF on ATI hardware now?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!