Previous Blog Next Blog
Prev/Next Blog
by date

DayOfWar SixSidedSpheres 2nd try

DayOfWar SixSidedSpheres 2nd try
Name:Bill Vee 
Date Posted:Apr 07, 2008
Rating:4.8 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Bill Vee

Blog post
OK I got bored and a little mad so I decided to try the post again.

My approach is similar to the way Spore appears to do planets.

You take six heightfields and create a cube with them.

This is a unfolded cube. Each square is a heightfield.


Where 1 is the north pole and 6 is the south pole.
And 2 3 4 and 5 are regoins around the equator.
As should be apparent you have to wrap the terrains in a very special way or you will have visible seams.
Square 1's left side needs to wrap with square 2's top and 1's right side needs to wrap with 5's top and so on.

Now doing something like taking each heightfield and applying a spherical distortion will give you a bulged square that will give you a sphere with large gaps.


What is needed is to take the heightfield and project them from a center point.

The next set of images show how this specially projected atlas terrain is not square.





This is a picture of the planet with all six atlas terrains configured like a cube.


This shows the same planet with the top terrain moved up a little to show how they fit together.


After 7 complete rewrites of my planet code here is what I have.
I have 3 different ways to achieve the spherical cubes from above.

The first is a custom importer that is used to create a atlas file with the correct projection.
This one is 100% done and has the benefit of creating atlas files that can be loaded by any version of TGEA with no code modification

The second is a runtime converter that takes a standard atlas file and applies the projection at load time.
This one is 95% done. I am still having some issues with re projecting the bounds for each chunk due to the way the atlas file stores them in the file.

And the best for last.
A atlas derived class that takes all six heightfields and creates a single Spherical Cube based CLOD terrain system. It has all the advantages of clipmapping, paged terrain, blended terrain and is able to load/create lightmaps in game.
This one is about 65% done.

If you would like to test the first example you can download the file from here.

Recent Blog Posts
List:05/31/08 - DayOfWar Six Degrees Of Freedom Camera System
05/26/08 - DayOfWar Player Controls
05/08/08 - DayOfWar more Asteroids
05/05/08 - DayOfWar Moons/Asteroids
04/28/08 - DayOfWar Oceans
04/07/08 - DayOfWar SixSidedSpheres 2nd try
04/07/08 - DayOfWar SixSidedSpheres
02/22/08 - DayOfWar is a Finalist.

Submit ResourceSubmit your own resources!

Peter Simard   (Apr 07, 2008 at 04:43 GMT)
Wow, that's some impressive work you've done there. Spherical terrains seem to be the holy grail to many developers around here. I can't wait to see the interesting games that come from this.

Tom Spilman   (Apr 07, 2008 at 05:13 GMT)   Resource Rating: 5
Very cool stuff Bill.

Ramen-sama   (Apr 07, 2008 at 05:42 GMT)
Quite cool. do you have gravity behaving appropriately?

Dunsany   (Apr 07, 2008 at 05:54 GMT)   Resource Rating: 5
Very cool.

Middle East Technical Uni. (#000   (Apr 07, 2008 at 07:10 GMT)
Impressive work! And this may be useful for the physical behaviour:
http://www.garagegames.com/blogs/19442/14512

Stefan *Shaderman* Greven   (Apr 07, 2008 at 07:57 GMT)
I won't need it (yet) but... WOW, looks great :)

Bill Vee   (Apr 07, 2008 at 10:37 GMT)
@Ramen-sama
Gravity was solved by a special type of trigger some time ago.

Don Hogan   (Apr 07, 2008 at 16:47 GMT)   Resource Rating: 5
Bill, it's always an interesting read to see how Day of War is using tech in new ways. Thanks for sharing!

Todd Pickens   (Apr 08, 2008 at 01:00 GMT)
That really rocks Bill!

I would love to play with version 3 when it is done.

Sorin Daraban   (Apr 08, 2008 at 06:23 GMT)
How about water?
Is it possible to do the same with the water planes so there can be water on the planet?

Very cool stuff, by the way.

Bill Vee   (Apr 08, 2008 at 13:49 GMT)
@Sorin Daraban
You can project the geometry for the waterblock the same way I did for the terrain.

While the shape is a hemisphere the relection appears to be planer.
A change to the shader should fix that.

Sorin Daraban   (Apr 08, 2008 at 21:56 GMT)
Wow...

Very nice.
Thanks for the quick info.

T Squared (Thanhda Tie)   (Apr 12, 2008 at 05:36 GMT)
awesome stuff dude.

Barry(dance)Smith   (Apr 15, 2008 at 23:49 GMT)
Spherical Cube Test:

The camera position started in the middle so I thought the example wasn't working then I zoomed way out and found the planet. Nice Job....




Edited on Apr 16, 2008 00:12 GMT

Nathan Kent   (Apr 30, 2008 at 23:23 GMT)
You would be able to make tunnels/dungeons the same way, wouldn't you? That would really increase the incentive for me to buy TGEA.

You must be a member and be logged in to either append comments or rate this resource.