Maggy on the GPU

This is very ‘warts and all’ this week. I’ve made some considerable progress moving the terrain deformation onto the GPU with some fantastic early results, but due to the work that needs doing on the patch visibility, and LOD’ing code it’s a bit ropey to see in the video, so please forgive the crudity of the terrain, it’s all I had time for 😉

Thanks to some geniuses who kindly publish their work for the greater good of everyone, I am able to produce excellent looking first pass terrain by standing on the shoulders of giants. They have published their work on the Perlin Noise functions, and one kind gentlemen has been incredibly helpful in converting his shader implementations from the Unity3D Asset Store into OpenGLSL for me to use in Dominium.

My aim is to port these to C/C++, as I will need to produce the same height calculations CPU side for flora/fauna/building instancing – and I don’t want to keep pulling data back from the GPU via textures/FBO’s. Once this is done, I’ll host the source code for this as a small static C/C++ library, along with the OpenGLSL noise shaders for everyone to benefit from.

I’m planning to write a more in-depth technical blog to wrap up the work I’m doing, and cite references to these kind folk. First, I want to sort out the visibility issues I’ve introduced as I’ve experimented. Although I can squeeze far more detail out of the terrain now it’s GPU based, the vis testing is still leaving way too many patches ‘visible’ when they aren’t, and also it tends to ‘choke’ and render everything when it shouldn’t!

So, vis testing fixups next, then I want to experiment with a few noise modifiers to see if my longer term intentions are viable.

All good fun!


PS. The ‘stripes’ in the feature image are deliberate! It’s a test grid texture, but it’s being mip’d / blurred too much so it looks a little awful.


  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati
Author: Mak View all posts by

Comments are closed.

Get an awesome sticky message bar!Download