Skybox Basic Details: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
m Thumbnailed the images
Petike (talk | contribs)
m adding category tag
 
(16 intermediate revisions by 7 users not shown)
Line 1: Line 1:
=How to make a prefab skybox=
'''How to create sky:'''


The easiest way to use a skybox in The Dark Mod is to use the prefab ones which come in the resources.
# Go to {{menu|l1=File|l2=Load Prefab}}, navigate to the '''prefabs''' folder and select '''nature\skyboxes\tdm_sky_starry1.pfb'''.
# Check the '''Texture Lock''' [[Image:DRtexLock.jpg]] status, it must be enabled. Lock textures on the [[prefab]] by pressing {{key|name=S}}, or the moon texture may get out of alignment.
# The loaded prefab is already selected, so move it out of the way of your normal map geometry. The exact place doesn't really matter, just move it where it doesn't get in the way later.
# In your map, texture the '''inside facing sides''' of your sky brushes with '''<code>textures/smf/portal_sky</code>''', by selecting them with {{key-ctrl}}+{{key-shift}}+{{LMB}}.


The first thing to do is create a textured box around your level. This can be caulk or texture, the important thing is that it has a texture so that the level is sealed.  
Finished. When you load your level, you will see an attractive night sky with clouds, moon and stars.


The most simple thing to do is to make a box around the level and use the hollow tool.
=== How to change the moon ===


[http://img226.imageshack.us/img226/4963/84078566bs0.jpg http://img226.imageshack.us/img226/4963/84078566bs0.th.jpg]
Go to the loaded prefab, and hide everything until you find a very tiny brush. This brush has the moon texture on one side, and the placement of this brush changes the place of the moon on the sky.


[http://img59.imageshack.us/img59/6734/74703655hm7.jpg http://img59.imageshack.us/img59/6734/74703655hm7.th.jpg]
=== How to change sky background color ===


Texture the inside facing sides with the textures/textures/smf/portal_sky texture, ensuring you only texture the inside facing sides, selecting them with control shift click.
If you use the tdm_sky_starry1.pfb in the directions above, notice that there's a patch mesh in the skybox room covered with a blank white texture <code>(textures/darkmod/nature/skybox/starry1/skyfade)</code>; in many maps it shows up as black, however -- that's because in the shader definition it has <code>"spectrum 2"</code>, meaning that it is only lit by light textures in that spectrum. Most lights you place are usually in spectrum 1, so nothing is lighting that white texture, and so it ends up black!


[http://img120.imageshack.us/img120/3702/77003234sb4.jpg http://img120.imageshack.us/img120/3702/77003234sb4.th.jpg]
So, place a light in the middle of the skybox room. Choose a light texture with "spectrum2" in it <code>(lights/spectrum2Light_round)</code> and choose a dark color for the light (maybe #0A192B?). Keep in mind that [http://media.photobucket.com/image/night%20sky%20trees/calendermod/NightSkyTrees1.jpg the sky is usually brighter than the Earth's surface in real-life, especially at night] -- and for ease of level readability and cool silhouettes, it's probably better for you to follow that. (e.g. my level's outdoor ambient light "value" is 5, but my level's skybox background light "value" is "16") However, you should definitely test often and see what settings you like.


[http://img59.imageshack.us/img59/2491/35449053rg0.jpg http://img59.imageshack.us/img59/2491/35449053rg0.th.jpg]
== Background information ==


Go to the edit menu, then “Load prefab” and navigate to the “prefabs” folder in “darkmod” folder and select “tdm_sky_starry1.pfb”.
To get good performance, you have to create spaces that are separated by [[Visportals]] from each other.


[http://img71.imageshack.us/img71/869/48886392io8.jpg http://img71.imageshack.us/img71/869/48886392io8.th.jpg]
Therefore the outside area of your building should be a series of corridors around the building with the brushes designated ''skybox'' stretching from the outside wall or buildings forming the border of your level, to the highest point of the building you want to be visible, to the top of the roof. Note, PortalSky used here will show sky in front of whatever is behind, Caulk used here will show sky but also allow func_static (not worldspawn brushes) that have part in the same "leaf" section. This use of Caulk allows sealing, but also permit skyline to appear beyond.


[http://img59.imageshack.us/img59/8646/71894725lp0.jpg http://img59.imageshack.us/img59/8646/71894725lp0.th.jpg]
This enables the use of visportals stretching from the skybox to the ground at key corners, so that when you are standing on the north side of the map, you won't also be seeing (and rendering) the south side at the same time.


[http://img226.imageshack.us/img226/41/12625019uj3.jpg http://img226.imageshack.us/img226/41/12625019uj3.th.jpg]
The sides of the brushes which face outside the level have to textured with anything that is solid and a valid texture, people often use caulk, but as long as it's not <code>no_draw</code>, you're fine.


Place this outside the main hollow box of your level. It is caulked on the outside and sealed so it will not leak.
{{tutorial-editing}}
 
[[Category:Skybox]]
[http://img71.imageshack.us/img71/9610/98009669xk2.jpg http://img71.imageshack.us/img71/9610/98009669xk2.th.jpg]
[[Category:Mapping Tutorials]]
 
Finished. When you load your level you will have an attractive night sky with clouds moon and stars.
 
[http://img71.imageshack.us/img71/841/69658107tm5.jpg http://img71.imageshack.us/img71/841/69658107tm5.th.jpg]
 
[[Category:Editing]]
[[Category:Tutorial]]

Latest revision as of 15:20, 21 November 2018

How to create sky:

  1. Go to File -> Load Prefab, navigate to the prefabs folder and select nature\skyboxes\tdm_sky_starry1.pfb.
  2. Check the Texture Lock status, it must be enabled. Lock textures on the prefab by pressing S, or the moon texture may get out of alignment.
  3. The loaded prefab is already selected, so move it out of the way of your normal map geometry. The exact place doesn't really matter, just move it where it doesn't get in the way later.
  4. In your map, texture the inside facing sides of your sky brushes with textures/smf/portal_sky, by selecting them with CTRL+SHIFT+Click the left mouse button.

Finished. When you load your level, you will see an attractive night sky with clouds, moon and stars.

How to change the moon

Go to the loaded prefab, and hide everything until you find a very tiny brush. This brush has the moon texture on one side, and the placement of this brush changes the place of the moon on the sky.

How to change sky background color

If you use the tdm_sky_starry1.pfb in the directions above, notice that there's a patch mesh in the skybox room covered with a blank white texture (textures/darkmod/nature/skybox/starry1/skyfade); in many maps it shows up as black, however -- that's because in the shader definition it has "spectrum 2", meaning that it is only lit by light textures in that spectrum. Most lights you place are usually in spectrum 1, so nothing is lighting that white texture, and so it ends up black!

So, place a light in the middle of the skybox room. Choose a light texture with "spectrum2" in it (lights/spectrum2Light_round) and choose a dark color for the light (maybe #0A192B?). Keep in mind that the sky is usually brighter than the Earth's surface in real-life, especially at night -- and for ease of level readability and cool silhouettes, it's probably better for you to follow that. (e.g. my level's outdoor ambient light "value" is 5, but my level's skybox background light "value" is "16") However, you should definitely test often and see what settings you like.

Background information

To get good performance, you have to create spaces that are separated by Visportals from each other.

Therefore the outside area of your building should be a series of corridors around the building with the brushes designated skybox stretching from the outside wall or buildings forming the border of your level, to the highest point of the building you want to be visible, to the top of the roof. Note, PortalSky used here will show sky in front of whatever is behind, Caulk used here will show sky but also allow func_static (not worldspawn brushes) that have part in the same "leaf" section. This use of Caulk allows sealing, but also permit skyline to appear beyond.

This enables the use of visportals stretching from the skybox to the ground at key corners, so that when you are standing on the north side of the map, you won't also be seeing (and rendering) the south side at the same time.

The sides of the brushes which face outside the level have to textured with anything that is solid and a valid texture, people often use caulk, but as long as it's not no_draw, you're fine.