Procedurally textured planets

Latest development is procedural planet textures.

The textures map seamlessly on a 3D sphere and the procedure to create them comes from this.

Ported some of this code to c# and created some examples of how they look:

Earth-like planet with a lot of water

Mars-like planet with a lot of ICE?

And this is how they look mapped on a sphere and with atmospheric scattering!!

The nice thing is that they look much better than photographs of existing planets.

And off course they can be generated in all different sizes and colours.

 

Archived: Uncategorised

Big milestone

A very big milestone. The Rock shader I was working on is finally complete.

With a lot of trial and error the triplanar bump mapping works togethers with the specular reflections. Lighting is now correct.

And I created a new skybox because it’s getting boring looking at the same sky over and over again.

Will release the hlsl shader soon….

Archived: Uncategorised

Look Ma – It’s shiny!!

Updated the procedural rock and awesome shader to create bumps on the rock and now finally it looks great.

The inspiration for this all was the opengl shader from Cave3d, a very inspirational google project that shows some fantastic graphics.

The porting to HLSL and the triplanar blending went well but the lighting and specularity were wrong (Due to wrong normals and blending problems).

Then I looked at the Cascades sample and looked at the triplanar texturing part. After that I had some specular artifacts (extreme white dots and flickering) and it looked just plain horrible.

But finally the last piece of the puzzle was found on Petrocket blog that used 6 texture samples to create the bump vector.

The shader on Petrocket calculates the normals in world-space but while that is good for static objects, this is not good for moving rocks (world transformed).

So I calculate the UV’s in object space and also the normals!!! With the increased sampling the normal vector is now reliable enough to give correct lighting and specularity.

I switched back to Lambert shading because this gives the best results (this was also used in the Cave3d shader.

Here are some pictures that speak for themselves:

You can see the triplanar blending if I render with RED, GREEN and BLUE components:

 

Archived: Uncategorised

Overwhelmed by awesome rock

Can it get better that this? This looks real enough for me……

overwelmingly_perfect

It’s a shader with bling-phong lighting model. The diffuse and normals are blended together. The model only has position and normal data. No UV-mapping!!!

Archived: Uncategorised

New procedural noise shader : Voronoi

Created a new noisy shader to create graphical effects for my ‘Procedural Rocks’. It is based on a shader mentioned on gamedev : Journal of Ysaneya

And I got a basis implementation for this effect from : A hybrid approach for procedural planets.

But I stripped the noise functions, deleted the UV mapping (because of procedural won’t have assigned UV mapping) and created these images:

voronoi_noise_sphere voronoi_noise_rock

This could be used for craters, cracks and many other possibilities.

Sources for this sample can be downloaded here

Archived: Uncategorised

Psirens converted to XNA 4.0

Psirens is converted to XNA 4.0, and it was about a half day to get it running.

It looks like crap (culling, shading and transparancy problems). This will take some time to fix….

psirens_xna40

Here is a collection of links to help with the XNA 3.1 to 4.0 conversion:

http://blogs.microsoft.co.il/blogs/grozen/archive/2010/10/23/converting-a-3d-xna-3-0-game-to-xna-4-0-an-example.aspx

http://www.hexworld.co.uk/blog/?p=111

http://blogs.msdn.com/b/shawnhar/archive/2010/04/05/spritebatch-and-custom-renderstates-in-xna-game-studio-4-0.aspx

http://blogs.msdn.com/b/shawnhar/archive/2010/04/19/vertex-data-in-xna-game-studio-4-0.aspx

The blog of shawn hargreaves explains a lot so check his entire site for info.

Archived: Uncategorised

Moonrocks threatening the earth…

Placed the procedural asteroids around the earth sphere. Added rotation, direction and speed. I was wondering if the procedural texturing would make the system bog down.

But it didn’t, so it won’t break a sweat on the Xbox 360 either I suppose. What takes a bit longer on the Xbox however is the creation of the rocks.

But that is probably because of the poor floating point performance of the Xbox.

I guess the Moon is finished…..

Archived: Uncategorised

Rocky asteroids part III

Expanded the rock shader with some ambient lighting. This makes the asteroid look less flat and show some more of the structure.

This is medium complex asteroid that still looks a bit dark, but looks detailed from a distance.

This is the highest complex rock. It looks like coal. It is probably a good idea to add some white parts that looks like ICE.

Archived: Uncategorised