Skip to content


GPU Normal Maps (maybe?)

I threw in some code to gen up normal maps. What came out kind of looks like a normal map, I just need to figure out how to do lighting with it.

I’m sure I’m doing it completely wrong. Either way it’s pretty looking.

Posted in Programming, Terrain.


It’s been awhile.

GPU noise gen is go. Moving to Direct3D 10 as well.



Posted in Programming, Terrain.


New Video Up

I put a new video up on YouTube to show how it’s going. I’ve added some new features to the code to take the strain off of generating all of those terrain patches. Note that I intentionally included seams between the nodes to show the LOD changing at work.

I use a couple of runs of Perlin noise to generate elevation data for nodes in my quadtree. This is done recursively until I hit a leaf node, at which point GPU resources are allocated so that I can render to the screen. All nodes consist of 65*65 vertices, all of which need to run through my noise function to determine things like screen space error constants and bounding volumes. Noise generation is by far the slowest piece of code I have right now. Through experimentation I’ve found that I can only squeeze two nodes through the noise function per frame, otherwise the program will “hiccup” as you move around.

First thing I tried to speed things up was to implement a LRU cache for nodes. Each quadtree node is given a cache ID for itself and it’s potential children. When it comes time to switch to a lower LOD, a request is made to the TerrainNodeGenerator object. This object checks the cache, and returns the data if it’s available. If not it creates the elevation data, throws it in the cache, then returns it to the requesting node. When detail levels change the data gets reused if it was recently generated and in cache.

This smoothed things out when moving short distances, but I still needed to limit the amount of requests per frame.

Within the TerrainNodeGenerator object I created a queue of TerrainNodeRequests. New requests are now put into a queue, which were worked off at a configurable interval. This was the magic bullet I needed and framerates jumped way up. Hiccups are gone and I can now start working on materials and texturing.

Posted in Programming, Terrain.

Tagged with , , , , , , , .


Silverlight

Spending some time learning about Silverlight for work. Like Blend, like XAML, really not digging all the extra plumbing needed for binding.

Posted in Programming, Twitter.


Spherical LOD

Progress is steady. I’ve spent quite a bit of time this weekend and last refactoring the engine. Good new is that now I have the basics of spherical LOD done so I can focus on planetary rendering.

I’ve been playing around with FRAPS and VirtualDub this weekend so that I can get some YouTube videos going. Here’s a quick one to show the chunked quadtree patch subdivision.

Posted in Programming, Terrain.

Tagged with , , , , , .


Quick Update

I’ve decided that before I get much further along, I’d like to make the terrain spherical so I can simulate planets. I’m going with the approach outlined at the Britonia site. Of course this means I have to rework a lot of the system to work with spheres. Getting the camera to play nicely has been a lot of trial and error. I still have the LOD code to fix up.

I’m happy that the August 2009 DirectX SDK is finally out (in September). There was a bug in the previous release which caused my applications to crash in Windows 7 while using the debug runtime. Looks like I can finally use Windows 7 drivers in Windows 7!

And because everyone likes pictures…

PlanetTest

Posted in Programming, Terrain.

Tagged with , , , , .


Some Development Screenshots

I’ve got a nice 3 day weekend to work on the engine. I’ve found that geomipmapping alone doesn’t scale very well, so I’ve started investigating Chunked LOD. More on that when I get my implementation working.

Until then, I just wanted to upload some more dev screenshots.

Posted in Programming, Terrain.

Tagged with , , , , .


Writing a terrain generator/viewer.

This is a project I find my self trying to get into from time to time. I usually end up getting distracted after getting little work done on it.

This week I’ve managed to get a basic terrain visualizer going. I’m using some procedural noise and geomipmapping for continuous level of detail. Functionality is very basic, but if I can find some time I’d like to polish it up and release something.

Quadtree Hell

Quick visualization for the quadtree structure used. Reminded me of Tron.

TerrainLasagna

Small error turns the terrain into lasagna.

geomipmappingDone

Geomipmapping LOD finally working. Huzzah!

Posted in Programming, Terrain.

Tagged with , , , , .