Skydome TUT using GLSL gradients: 1/2 finished

You will need a recent Apricot build to and a graphics card that supports GLSL to follow this tut.

In this tut I will show you how to use the new GLSL shaders and nodes to make sweet looking skydomes like this…Which you can see right in the viewport.

http://blendershare.servebeer.com/newblenderforum/gallery/56_11_09_08_12_48_29.jpg

here’s another pic showing the wireframe and the node setup
http://blendershare.servebeer.com/newblenderforum/gallery/56_11_09_08_12_52_26.jpg

So right now you are thinking… but can’t I just make a skybox or a dome and map a picture to it?
…Well yes you can… but I like my skies to be real domes with a gradient I can control.
If I can control the gradient colour I can makes lots of different skies just by editing the gradient right in blender on the fly.

I also hate horrible seems. Unfortunately Sphere mapping creates distortion and seams.
Yes you can hide the seams a bit by doing various tweeks in gimp and photoshop but bugger that.

This can save oodles of time. It should be possible to bake this into a texture map( I haven’t tested this yet tho).
That is if you need to speed up the game because GLSL is to slow on your card.
There’s a tut on blendernation that show’s you how to do this when you use the GLSL shaders to mix textures to paint a head.

http://www.blendernation.com/2008/08/26/tutorial-texturing-a-head-with-glsl/

This method avoids seams because I use the global co-orindates to map the gradient to the dome.
Of course if the sphere mapping button worked in the game engine.
I.E you can map a sphere to an object without using UV’s…
You would see no seam if your map was a perfectly tiling panoramic image,
Even if your dome is low poly. But until then this is how I do it.
http://blendershare.servebeer.com/newblenderforum/gallery/56_11_09_08_1_07_04.jpg

Also using gradients that are mapped to the global co-ordinates can let you make cool fire effects.
If the gradient and texture bug has been fixed in the nodes.
I will test that out later.

One disadvantage of using global co-ordinates is that if you move the sky dome… up or down.
The gradient stays put.
This can also be an advantage when making smoke particles etc.
It might be possible to get the same effect using the local co-ordinates.
This would mean that the gradient moves with the dome… should you want to parent it to the player or something.

Enough theory… on with the tut
1.Make a new blendfile.
Go to the top view
Create an ico sphere with 3 subdivisions. (you might be able to get a away with less)
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_12_01_15.jpg

3.Scale up the sphere to the following values.
x:260
y:260
z:160
The shape is more ellipsoid… generally this looks a lot better.
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_12_11_13.jpg

4.You might notice some camera clipping issues because this is a mighty huge skydome.
To fix that do the following.
Click on the view menu button… choose view properties.
On the menu that pops up select the clip end value.
Enter 100000 or the some huge number…
If you enter higher than a certain number it just defaults to the highest value.
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_12_22_34.jpg

5.Rename the sphere to skydome_01
Add a new material and call it skydome_01.
Set it be shadeless.
Make sure you’ve turned on Blender GLSL materials found under the game menu.
Your scene up until this point should look like this.
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_12_48_33.jpg

6.To see the dome in the bkrnd we need to flip the normals.
So press tab to go into edit mode
Turn on draw normal… so you can see if you have actually flipped them
Press flip normal.
In the image below BEFORE I’ve flipped the normals.
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_12_59_13.jpg

How the normals look after they have been inverted
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_1_10_29.jpg

7.So if you zoom back in to the scene, you should see the grey sky dome appearing in the bkrnd behind everything.
http://blendershare.servebeer.com/newblenderforum/gallery/56_12_09_08_1_32_07.jpg
ddd

Why not just set the world to a gradient?

@Killer World blends/horizon gradients don’t appear in the game engine.
Also with this method as I’ve mentioned you can make lots of different skydomes for different times of day which can be replaced in your scene as you play the game.

not even with glsl?

Mmm… I also think there’s a simpler way, like using a low resolution texture on the sphere so it looks blurred. then play around making it more transparent and using the color of the world…

Maybe we could have lovely skies like in Torque