Sign in to follow this  
nilkn

Open source XNA terrain renderer

Recommended Posts

This is technically a work in progress, but the terrain render itself is finished, so I thought I'd share it with the game development community if anyone is interested. I've learned a lot from the game development community and especially from Gamedev.net, so I feel it's my duty to share my work. I actually wrote this a few months ago, but I'm just now getting around to sharing the code. It's a terrain renderer written in C# and built on XNA 2.0. It uses a custom version of Chunked LOD to dynamically manage the resolution of the terrain based on the viewer's position and the complexity of the geometry. It minimizes the amount of geometry stored in memory by creating a single small grid and dynamically displacing it in a vertex shader to draw each terrain chunk using vertex texture fetches. The terrain is also dynamically normal mapped. Finally, it has a rudimentary grass renderer in place that will render grass if the camera is in close enough proximity. I've included the full source to the project and all the project files. I'm mainly releasing this in the hope that someone will be able to benefit from the source code. I'm no expert programmer, so my code is far from perfect, but perhaps someone facing some of the challenges I faced in developing this renderer will find my code useful. I did fully comment all the code so that others could follow along easily. I've uploaded all the files to GameProjects here. Screenshots are also available there. I hope someone finds this helpful. [smile]

Share this post


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