So the last blog update has barely dipped it's toe into the ocean that is the internet and I've got more to talk about.
After getting my noise to render correctly, I was ready for the big task of creating the terrain manager to make the patches.
I am currently really poor at estimating how long something will take me. Those tasks that I'm convinced shouldn't take long seem to take much longer and task that I fear will take too long barely take any time at all... Fortunately that's working in my favour at the current moment in time.
Implementation of my terrain manager wasn't plain sailing however.
After getting my noise to render correctly, I was ready for the big task of creating the terrain manager to make the patches.
I am currently really poor at estimating how long something will take me. Those tasks that I'm convinced shouldn't take long seem to take much longer and task that I fear will take too long barely take any time at all... Fortunately that's working in my favour at the current moment in time.
Implementation of my terrain manager wasn't plain sailing however.
I didn't pay attention to the values I was passing into the manager to tell it what to create. I learnt that I'd told it to make 100 by 100 patches. All with 512 quads by 512. This amounts to 5,242,880,000 triangles, with each vertex evaluating it's 8 neighbouring vertices to calculate their normals. Needless to say, my computer needed to be rebooted.
After altering the values and fixing a few accompanying bugs, I managed to render some patches. These were broken and rendered the same displacement. Which is fine: it's what I expected. My next step was passing in an offset for the terrain. After a bit of playing about, I managed to get the terrain to join up seamlessly.
After altering the values and fixing a few accompanying bugs, I managed to render some patches. These were broken and rendered the same displacement. Which is fine: it's what I expected. My next step was passing in an offset for the terrain. After a bit of playing about, I managed to get the terrain to join up seamlessly.
![Picture](/uploads/2/5/0/0/25004518/2132240.png?457)
I was really happy with what I had. Even more so when I adapted it so that it's really easy to move around the entire terrain.
I felt like I still had some work left in my so considered what I should do next.
I already had a pointer to the player position as well as the position of every patch. So I implemented a quick distance based LOD hack. It's a hack because I simply check the squared distance and strip the value so that as the distance increase, there's less detail. Because of the manner in which I calculate the LOD, the next level of detail down is a shorter radius that the previous one. I may end up improving it but only if it really requires it, as it currently is, it does a good enough job:
I felt like I still had some work left in my so considered what I should do next.
I already had a pointer to the player position as well as the position of every patch. So I implemented a quick distance based LOD hack. It's a hack because I simply check the squared distance and strip the value so that as the distance increase, there's less detail. Because of the manner in which I calculate the LOD, the next level of detail down is a shorter radius that the previous one. I may end up improving it but only if it really requires it, as it currently is, it does a good enough job:
![Picture](/uploads/2/5/0/0/25004518/6683567.png?446)
It's weird to see this all working and getting it all up and running so quickly. I don't feel any smarter than I was a year ago, but the progress and the speed at which I'm progressing does seem to suggest that I have indeed improved, or certainly learnt from my mistakes last year.
As expected, the LOD results in cracks, but I won't concern myself with that for the moment, if It's a large issue, I will just increase the radius as the LOD doesn't crack that back for the first couple.
As expected, the LOD results in cracks, but I won't concern myself with that for the moment, if It's a large issue, I will just increase the radius as the LOD doesn't crack that back for the first couple.
Still not content on just leaving the project where it is for the time being, I pushed on and implemented CPU based improved Perlin noise. I was pleased to see it implemented as easily as I had hoped. I plan to create a GPU version, as I did for my Honours project, but I'll leave that until I actually need it. I'm really pleased with my progress as I had put a big task on myself, I'm just hoping to reap the rewards.