| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Buried in cloud files? We can help with Spring cleaning!

    Whether you use Dropbox, Drive, G-Suite, OneDrive, Gmail, Slack, Notion, or all of the above, Dokkio will organize your files for you. Try Dokkio (from the makers of PBworks) for free today.

  • Dokkio (from the makers of PBworks) was #2 on Product Hunt! Check out what people are saying by clicking here.

View
 

Shader_1337_Skybox

Page history last edited by PBworks 15 years ago


 

Skyboxes in the Quake 3 Engine

Skyboxes in the Quake 3 Engine consist of several types.

  • There is the simple sky shader, a shader mostly used to create clouds floating by. Its fault however is that you cannot have a player look at it when the shader is lower than the player origin because it will cause a Hall of Mirrors effect.
  • The stationary skybox consists of 6 pictures who combined form a panoramic view. This one is used most in current day. However there is a problem. It is stationary. It does not have any moving clouds.
  • Ydnar developed a solution combining both of them a few years ago. In essence it combines the panoramic view with a sky shader. This is known as the 1337 skybox and an adapted form of it will be discussed in this article.

 

Necessary materials

 

Seamless tiling image

 

Because of the skybox nature we need a high-res tiling image of a sky. This means that the image itself should not be obviously tiling and thus repeating distinct marks are not desired. Obvious tiling comes from distinct features like a nebula or particulary easily distinguishable star.

 

Example can be viewed here

 

Resize your source image to 1024x1024 and save it as sky_clouds.tga

 

Sometimes a sky_mask.tga is included for further manipulation. It looks like this

 

Env images

 

These 6 images decide the landscape. In a starscape they should be 8x8 pixel .tga consisting of the color you want the lower half of the skybox to be viewed as. They are all the same colour and should be located in textures/MAPNAME/env.

  • sky_bk.tga
  • sky_dn.tga
  • sky_ft.tga
  • sky_lf.tga
  • sky_rt.tga
  • sky_up.tga

 

Shader

You will also need to add a shader in your MAPNAME.shader for it to operate correctly.

 

 

Stationary Shader

The following makes a stationary shader with a red sunlight coming in under an angle.

 

textures/MAPNAME/sky

{

skyparms textures/MAPNAME/env/sky 1024 -

q3map_lightImage textures/MAPNAME/sky_clouds.tga

 

//*** VARIABLES START ***

q3map_sunExt 200 80 30 80 20 55 2 12

q3map_lightmapFilterRadius 0 8

q3map_skyLight 70 3

q3map_sun 200 80 30 80 20 55

//*** VARIABLES END ***

 

surfaceparm sky

surfaceparm noimpact

surfaceparm nolightmap

surfaceparm nodlight

 

nopicmip

nomipmaps

 

qer_editorimage textures/MAPNAME/sky_clouds.tga

{

map textures/MAPNAME/sky_clouds.tga

rgbGen identityLighting

}

}

 

Moving shader (original Ydnar's 1337 shader tutorial)

Used [http://i2.photobucket.com/albums/y50/Drietand/Q3Wtower/sky_clouds.jpg>|this image] originally. Creates a moving cloudsky. Using another image would make that image scroll by, so might be usefull for a drifting spaceship.

 

textures/MAPNAME/sky

{

qer_editorimage textures/MAPNAME/sky_clouds.tga

 

q3map_lightImage textures/MAPNAME/sky_clouds.tga

 

// light values tuned for -gamma 2 -compensate 4

q3map_sunExt 1 1 1 400 -30 45 2 12

q3map_skyLight 75 3

 

surfaceparm sky

surfaceparm noimpact

surfaceparm nolightmap

q3map_sun 3 2 2 70 315 65

q3map_surfacelight 75

skyparms - 512 -

 

skyparms textures/MAPNAME/env/sky 1337 -

 

nopicmip

 

{

map textures/MAPNAME/sky_clouds.tga

tcMod scroll 0.0025 -0.0075

rgbGen identityLighting

}

{

map textures/MAPNAME/sky_mask.tga

blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA

tcMod transform 0.25 0 0 0.25 0.1075 0.1075

rgbGen identityLighting

}

}

 

Usage

Load up your textureset and apply the shader named 'sky' to all brushes you intend to be viewed as such.

Comments (0)

You don't have permission to comment on this page.