I also created my own shader for the terrain as I found that Riemers, although very good as it had great detail, slowed my engine a little. The shader I came up with, while not being as pretty gives a faster render, I will put that up here to.
So on to the code. What I will do is break it down into chunks again and then offer the whole class at the end. I am not going to go over the basic terrain code as this is all covered in Riemers tutorial, for this please go to his site and read though the tutorial to get a better understanding, saves me repeating his tutorial. Also there are some methods I have commented out as they are unfinished, for example I am working on a random map generator, this is not complete so has been removed, also there is the color map generator for the terrain, this I have left as it is completed, but it was more of a folly rather than for any real purpose, I have left it in as a matter of completeness.
Here is an example of this in action, this code placed in the Update of your Game will stop your camera from going through the terrain and give it the impression of being solid.
Before Mouse Clicks
After wasfting the mouse, clicking left and right mouse buttons
[Class and shader was here, but can't post it, please see original blog post]
Well I guess my Water class is next, here is an image of it in action:
First some nice calm water, waves at an amplitude of .1
Now at amplitude 1
"lets go surfing now, everybody's learning how..."
Posted Mon, Oct 15 2007 2:59 PM by Charles Humphrey | Add post to favorites | Add blog to favorites
Filed under: Randomchaos 3D Engine, Terrain, XNA 1.0 [Edit Tags]