Code archives/3D Graphics - Mesh/HeightMapped GeoSphere

This code has been declared by its author to be Public Domain code.

Download source code

HeightMapped GeoSphere by MusicianKool2010
Update 3!
Create a tiled geosphere, so that not every triangle need be rendered. Planets can be millions of Triangles and still be fast!

Now using Improved 3d perlin noise to generate a heightmap. It looks pretty.

Future:
Foliage ?

Example below:


Engine below:
...

Comments

MusicianKool2010
...


lo-tekk2010
This is really cool.


RifRaf2010
very cool indeed.
just needs a way to used tiled textures for realtime up close environments


MusicianKool2010
...


Krischan2010
You could use Perlin Noise to generate a more realistic environment, should be faster, too. Here is an example how to apply noise to a spherized cube, including gradients for different types of planets (press SPACE to see the wireframed cube):




RifRaf2010
Christian, I sent you an email.. From gamemaker04@...


RifRaf2010
ive modified the code christian posted, to convert each patche of vertex colors into a 512x512 texture. I then created a blending program to blend highres textures into the solid gradients, and reexport to a more editable large texture, unwrapped like a cubemap..

Here you can load the image into photoshop or whatever for editing, the unwrapped image is easy to edit.

I made another routine to reexport this larger cubemap into individual chunks to use on the planet. the results so far are shown here.

if your interested in the end result , ill try to wrap a gui around all the bits and upload it somewhere.

http://www.empowergames.com/rifs_planets_test.jpg?

thanks for the interesting code & ideas.


MusicianKool2010
Very nice Kristian and RifRaf!

Kristian, yours looks great and is fast too.


Charrua2010
very nice work guys!
Juan


Bobysait2010
nice job

ps : your function "CreateSegCube()" does not return anything. It should return "Mesh"
Here, it only works if we set a parent on the call fo the function then GetChild() to access created mesh.


MusicianKool2010
Bobysait That is because "CreateSegCube()" makes 6 meshes , for a higher poly planet.


MusicianKool2010
update!


Ian Thompson2010
interesting to see this evolve... nice code. ;)


MusicianKool2010
Update!


MusicianKool2010
Update 3!


Axel Wheeler2010
Whoa! Did anyone really try this?

Here's the function:
Function GeodesicHeightmapedSphere(SphereHeightMap,Scale#,Multiplier#,Offset#,seed,Parent=0)


Here's the call:
GeodesicHeightmapedSphere(PHM,scale#,Multiplier#,Offset,Seed,MinOctaves,MaxOctaves,Planet)


Note the different signatures. Note the "Not enough parameters" error.

I guess the last update(s) changed the signature, but the example didn't change.

Please advise. Looks very interesting.


NoOdle2010
Very interested in trying this but the code at the top doesnt run at the moment. Does anyone have a version that does?

Thanks


puki2010
Why does it not run - do you get an error message? Did you create the include file: Planet Maker3.bb?


NoOdle2010
I get a MAV, and yes I remembered to include the file lol


Blitzplotter2010
It would appear that the function call at the top codebox wants to pass minoctaves and maxoctaves, the function in the codebox at the top doesn't have these. There is posts in this thread hinting at updates though.


I also tried excluding the function call with the extra minoctave & maxoctave to no avail - i.e. MAV. A debug compile reveals SphereHeightMap does not exist. Made my own heightmap (a 512x512 .bmp) & attempted to assign this to SphereHeightMap at which point I discovered the PHM.bmp within the compiling folder, therefore PHM.bmp is being successfully created.

Also created a detail.PNG (a 512x512 image just black & grey) to try & compile, no joy.

My attempt at getting it to complie with the modified codebox calling code fails here:

Function Get_ARGB_From(r,g,b): Return b Or(g Shl 8)Or(r Shl 16): End Function







@Krischan - love your planet maker! Krischans code mentions maxoctaves....


Eric2011


I am not sure if this is the entire fix, but I got the code to run... update the Planet Maker code.


-1 from the image dimensions.


Code Archives Forum