Skybox Tutorial: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
= Skybox Tutorial = | = Skybox Tutorial = | ||
This is the tutorial for skybox creation by Sotha. | |||
== Motivation == | == Motivation == | ||
Why bother creating a custom skybox? The standard starry prefab is just fine! | Why bother creating a custom skybox? The standard starry prefab is just fine! | ||
It indeed is, but everyone has seen it so many times. Creating a specific sky just for your mission gives your mission personality. With the sky, you can relate atmosphere and information on the location where the mission takes place. In the plains just outside the City? In the top of a high mountain, in the eternal snow? | It indeed is, but everyone has seen it so many times. Creating a specific sky just for your mission gives your mission personality. With the sky, you can relate atmosphere and information on the location where the mission takes place. In the plains just outside the City? In the top of a high mountain, in the eternal snow? | ||
With a some hours invested in sky creation you can make your mission seem real as it seems to be located somewhere. It does not exist alone in the world, you can see the world around it. | With a some hours invested in sky creation you can make your mission seem real as it seems to be located somewhere. It does not exist alone in the world, you can see the world around it. You can see the tiny hamlets and the fields surrounding the wealthy merchants manor. | ||
== Introduction == | == Introduction == | ||
Line 22: | Line 17: | ||
*Download and install Terragen. http://www.planetside.co.uk/content/view/16/28/ | *Download and install Terragen. http://www.planetside.co.uk/content/view/16/28/ | ||
== Scenery Building == | == Basic Scenery Building == | ||
The program window is shown in the picture 1. | The program window is shown in the picture 1. | ||
[[Image:Skybox_tutorial_terra1.jpg|200px|thumb|right|Picture 1]] | [[Image:Skybox_tutorial_terra1.jpg|200px|thumb|right|Picture 1]] | ||
Click the Generate Terrain -button. Since we are doing a skybox, we need the camera to be located near the middle of the map, so we are surrounded by the scene. Click left mouse button on the topology map on the Rendering Control -window to place camera in the middle of the scene. You can change the direction with the right mouse button. The grayscale topography image may not give much information on the resulting scene, so you can use the 3D preview button on the left. You can also use Rendering Preview and the actual Render Image -buttons to check what the camera sees. | First create your first terrain. Click the Generate Terrain -button and click again the Generate Terrain button in the appearing window. You'll see a grey topology map appear. Close the Terrain Genesis window. | ||
Since we are doing a skybox, we need the camera to be located near the middle of the map, so we are surrounded by the scene. Click left mouse button on the topology map on the Rendering Control -window to place camera in the middle of the scene. You can change the direction with the right mouse button. The grayscale topography image may not give much information on the resulting scene, so you can use the 3D preview button on the left. You can also use Rendering Preview and the actual Render Image -buttons to check what the camera sees. | |||
Now that you know how to see what you've created, you need to try to select the parameters so that you'll get close the kind of scenery you want (plains with distant mountains or barren mountain range). Hold your mouse above the settings (Realism, Smootinh, etc) to see what each parameters does. Experiment until you get something close what you want. The closer you get with the parameters, the easier the sculpting phase is. | Now that you know how to see what you've created, you need to try to select the parameters so that you'll get close the kind of scenery you want (plains with distant mountains or barren mountain range). Hold your mouse above the settings (Realism, Smootinh, etc) to see what each parameters does. Experiment until you get something close what you want. The closer you get with the parameters, the easier the sculpting phase is. | ||
== Sculpting the Scenery == | |||
When you're close with the scenery you want, save it so you can start from where you were is something goes wrong. Lanscape Window -> Terrain -> Save. Now we will sculpt the map. Click the topology map on the Landscape window. Now you can sculpt the scene with the Basic Sculpting Tool. Raise a mountain, remove a mountain, smoothen the plains and add a pit with smooth edges for a lake, or make a river. | When you're close with the scenery you want, save it so you can start from where you were is something goes wrong. Lanscape Window -> Terrain -> Save. Now we will sculpt the map. Click the topology map on the Landscape window. Now you can sculpt the scene with the Basic Sculpting Tool. Raise a mountain, remove a mountain, smoothen the plains and add a pit with smooth edges for a lake, or make a river. | ||
== Water, Surface and Skies == | |||
Next we set the water level. Click the water-button on the left. Set the water level and press update maps. You'll see light blue colors in areas with water. Set the levels so that you've realistic looking sea. Sculpt shores to be gently sloping. | Next we set the water level. Click the water-button on the left. Set the water level and press update maps. You'll see light blue colors in areas with water. Set the levels so that you've realistic looking sea. Sculpt shores to be gently sloping. | ||
Then we set the surface. In the landscape window there is Surface Map -section. Select open and try to pick up the kind of terrain textures you need. For plains "grass and sand" is just fine. For others you probably need to create your own surface map. | Then we set the surface. In the landscape window there is Surface Map -section. Select open and try to pick up the kind of terrain textures you need. For plains "grass and sand" is just fine. For others you probably need to create your own surface map. I cannot help with this at this time. | ||
You can edit the skies clouds by selecting the Clouds button on the left and set the ambience haze from the atmosphere button on the left. | |||
== Lighting == | |||
Finally we set the lighting conditions with the button on the left. Since TDM is a sneaking game you probably want to set the sun below the horizon. Maybe the mission occurs at midnight? Or just after sunset? Set the sun appropriately. Check the rendering preview. It probably looks too bright with the sun gone, so decrease Shadow Lightness (located in Lighting Conditions -> Background Light). If you end up in pitch black scenery, increase the Exposure time in Rendering Control -> Camera Settings. | Finally we set the lighting conditions with the button on the left. Since TDM is a sneaking game you probably want to set the sun below the horizon. Maybe the mission occurs at midnight? Or just after sunset? Set the sun appropriately. Check the rendering preview. It probably looks too bright with the sun gone, so decrease Shadow Lightness (located in Lighting Conditions -> Background Light). If you end up in pitch black scenery, increase the Exposure time in Rendering Control -> Camera Settings. | ||
== Rendering the Scenery == | |||
When you have everything the way you want we can proceed to the image capture phase. DOUBLE CHECK your work with the Render Image -button in every direction with low detail settings so everything looks good. Once the images have been captured you need to capture everything again if you notice something unpleasing in the resulting work. | When you have everything the way you want we can proceed to the image capture phase. DOUBLE CHECK your work with the Render Image -button in every direction with low detail settings so everything looks good. Once the images have been captured you need to capture everything again if you notice something unpleasing in the resulting work. | ||
Set all detail knobs you can find to maximum (Rendering Control -> Render Settings, Rendering Control -> Detail). Set image size to 960x960. This is the maximum resolution you'll get from the free version. Double check your camera settings. Is the camera in the correct position? | Set all detail knobs you can find to maximum (Rendering Control -> Render Settings, Rendering Control -> Detail). Set image size to 960x960. This is the maximum resolution you'll get from the free version. Double check your camera settings. Is the camera in the correct position? Does it capture the scenery details you want? Is the camera height from the surface correct? I used 6m for the plains skybox in picture 3. Check the camera ZOOM in Camera Settings: if this is any other than 1.0 your skybox will not align correctly (it defaults to 1.4 so change it!) Then capture the images. | ||
*Set Camera orientation: head 0, pitch 0, bank 0 | *Set Camera orientation: head 0, pitch 0, bank 0 | ||
*Render image and save it as yoursky_'''forward'''.bmp | *Render image and save it as yoursky_'''forward'''.bmp | ||
Line 55: | Line 52: | ||
*Set Camera orientation: head 0, pitch -90, bank 0 | *Set Camera orientation: head 0, pitch -90, bank 0 | ||
*Render image and save it as yoursky_'''down'''.bmp | *Render image and save it as yoursky_'''down'''.bmp | ||
Open each of your image files with GIMP or whatever and save them as .tga in to folder darkmod\env\custom | |||
== Create Material == | |||
Create a material file for you sky in folder darkmod\materials. Create a text file called Customskies.mtr. Fill in the following | |||
textures/skies/custom/yoursky | |||
{ | |||
qer_editorimage textures/custom/skies/yoursky.tga | |||
noFragment | |||
noshadows | |||
nooverlays | |||
forceOpaque // so transparent windows can draw on top of it | |||
{ | |||
blend add // so transparent windows can draw on top of it | |||
cameraCubeMap env/custom/yoursky | |||
forceHighQuality | |||
texgen skybox | |||
texgen wobblesky .0 .0 .0 | |||
} | |||
} | |||
== Creating the skybox == | |||
Fire up DR. You could just apply the sky texture you created (it should be in DR textures/skies/custom) on the ceilings on your map, but for distant buildings it is better to put smf/portal_sky where your sky should be. | |||
Create somewhere away from your main map a box shaped room with the texture you created. Place an entity info_portalsky exactly in the middle of the room. Now all the surfaces with the portal_sky textures show the contents of the info_portalsky room. Now you add details to your skybox by adding buildings in the small info_portalsky -room you created. You will notice that you have to make small toy-houses and place them just slightly below the info_portalsky and next to the wall in the skybox -room. See picture 3 to see a suggested setup. Notice the position and orientation of the moon slab, the size scale of the buildings and the position of the info_portalsky. | |||
[[Image:Skybox_tutorial_skybox.jpg|200px|thumb|right|Picture 2]] | |||
Add light source to light the buildings with moonlight. Add a simple square bursh with nodraw on all sides. Rotate the brush so that it's wide face is pointed straight towards the info_portalsky. To this face add the moon texture and FIT it there with surface inspector. You'll get a decent illusion of distant buildings (see picture 3). You can also add particle effects which show in the sky portals as well. | |||
[[Image:Skybox_tutorial_result.png|200px|thumb|right|Picture 3]] | |||
I've tried scaling existing models down with the rotation parameter, but they do not light up correctly by light sources. Therefore you have to create all small detail objects from normal brushes as the ones seen in picture 2. | |||
This concludes the tutorial and you should now be able to create your very own scenery! |
Revision as of 17:02, 21 July 2010
Skybox Tutorial
This is the tutorial for skybox creation by Sotha.
Motivation
Why bother creating a custom skybox? The standard starry prefab is just fine!
It indeed is, but everyone has seen it so many times. Creating a specific sky just for your mission gives your mission personality. With the sky, you can relate atmosphere and information on the location where the mission takes place. In the plains just outside the City? In the top of a high mountain, in the eternal snow? With a some hours invested in sky creation you can make your mission seem real as it seems to be located somewhere. It does not exist alone in the world, you can see the world around it. You can see the tiny hamlets and the fields surrounding the wealthy merchants manor.
Introduction
In this tutorial you will learn
- how to create a sky texture using Terragen.
- how to build a skybox using the landscape texture you created.
- how to add details (buildings) to the skybox.
Preparing
- Get aquainted with the basic idea what we are going to do. http://www.modwiki.net/wiki/Cube_maps
- Download and install Terragen. http://www.planetside.co.uk/content/view/16/28/
Basic Scenery Building
The program window is shown in the picture 1.
First create your first terrain. Click the Generate Terrain -button and click again the Generate Terrain button in the appearing window. You'll see a grey topology map appear. Close the Terrain Genesis window.
Since we are doing a skybox, we need the camera to be located near the middle of the map, so we are surrounded by the scene. Click left mouse button on the topology map on the Rendering Control -window to place camera in the middle of the scene. You can change the direction with the right mouse button. The grayscale topography image may not give much information on the resulting scene, so you can use the 3D preview button on the left. You can also use Rendering Preview and the actual Render Image -buttons to check what the camera sees.
Now that you know how to see what you've created, you need to try to select the parameters so that you'll get close the kind of scenery you want (plains with distant mountains or barren mountain range). Hold your mouse above the settings (Realism, Smootinh, etc) to see what each parameters does. Experiment until you get something close what you want. The closer you get with the parameters, the easier the sculpting phase is.
Sculpting the Scenery
When you're close with the scenery you want, save it so you can start from where you were is something goes wrong. Lanscape Window -> Terrain -> Save. Now we will sculpt the map. Click the topology map on the Landscape window. Now you can sculpt the scene with the Basic Sculpting Tool. Raise a mountain, remove a mountain, smoothen the plains and add a pit with smooth edges for a lake, or make a river.
Water, Surface and Skies
Next we set the water level. Click the water-button on the left. Set the water level and press update maps. You'll see light blue colors in areas with water. Set the levels so that you've realistic looking sea. Sculpt shores to be gently sloping.
Then we set the surface. In the landscape window there is Surface Map -section. Select open and try to pick up the kind of terrain textures you need. For plains "grass and sand" is just fine. For others you probably need to create your own surface map. I cannot help with this at this time.
You can edit the skies clouds by selecting the Clouds button on the left and set the ambience haze from the atmosphere button on the left.
Lighting
Finally we set the lighting conditions with the button on the left. Since TDM is a sneaking game you probably want to set the sun below the horizon. Maybe the mission occurs at midnight? Or just after sunset? Set the sun appropriately. Check the rendering preview. It probably looks too bright with the sun gone, so decrease Shadow Lightness (located in Lighting Conditions -> Background Light). If you end up in pitch black scenery, increase the Exposure time in Rendering Control -> Camera Settings.
Rendering the Scenery
When you have everything the way you want we can proceed to the image capture phase. DOUBLE CHECK your work with the Render Image -button in every direction with low detail settings so everything looks good. Once the images have been captured you need to capture everything again if you notice something unpleasing in the resulting work.
Set all detail knobs you can find to maximum (Rendering Control -> Render Settings, Rendering Control -> Detail). Set image size to 960x960. This is the maximum resolution you'll get from the free version. Double check your camera settings. Is the camera in the correct position? Does it capture the scenery details you want? Is the camera height from the surface correct? I used 6m for the plains skybox in picture 3. Check the camera ZOOM in Camera Settings: if this is any other than 1.0 your skybox will not align correctly (it defaults to 1.4 so change it!) Then capture the images.
- Set Camera orientation: head 0, pitch 0, bank 0
- Render image and save it as yoursky_forward.bmp
- Set Camera orientation: head 90, pitch 0, bank 0
- Render image and save it as yoursky_right.bmp
- Set Camera orientation: head 180, pitch 0, bank 0
- Render image and save it as yoursky_back.bmp
- Set Camera orientation: head 270, pitch 0, bank 0
- Render image and save it as yoursky_left.bmp
- Set Camera orientation: head 0, pitch 90, bank 0
- Render image and save it as yoursky_up.bmp
- Set Camera orientation: head 0, pitch -90, bank 0
- Render image and save it as yoursky_down.bmp
Open each of your image files with GIMP or whatever and save them as .tga in to folder darkmod\env\custom
Create Material
Create a material file for you sky in folder darkmod\materials. Create a text file called Customskies.mtr. Fill in the following
textures/skies/custom/yoursky { qer_editorimage textures/custom/skies/yoursky.tga noFragment noshadows nooverlays forceOpaque // so transparent windows can draw on top of it { blend add // so transparent windows can draw on top of it cameraCubeMap env/custom/yoursky forceHighQuality texgen skybox texgen wobblesky .0 .0 .0 } }
Creating the skybox
Fire up DR. You could just apply the sky texture you created (it should be in DR textures/skies/custom) on the ceilings on your map, but for distant buildings it is better to put smf/portal_sky where your sky should be.
Create somewhere away from your main map a box shaped room with the texture you created. Place an entity info_portalsky exactly in the middle of the room. Now all the surfaces with the portal_sky textures show the contents of the info_portalsky room. Now you add details to your skybox by adding buildings in the small info_portalsky -room you created. You will notice that you have to make small toy-houses and place them just slightly below the info_portalsky and next to the wall in the skybox -room. See picture 3 to see a suggested setup. Notice the position and orientation of the moon slab, the size scale of the buildings and the position of the info_portalsky.
Add light source to light the buildings with moonlight. Add a simple square bursh with nodraw on all sides. Rotate the brush so that it's wide face is pointed straight towards the info_portalsky. To this face add the moon texture and FIT it there with surface inspector. You'll get a decent illusion of distant buildings (see picture 3). You can also add particle effects which show in the sky portals as well.
I've tried scaling existing models down with the rotation parameter, but they do not light up correctly by light sources. Therefore you have to create all small detail objects from normal brushes as the ones seen in picture 2.
This concludes the tutorial and you should now be able to create your very own scenery!