]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / docs / manual / quake3 / Terrain_Manual / pages / lighting_the_terrain.html
1 <html>\r
2 \r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
5 <meta name="GENERATOR" content="Microsoft FrontPage 4.0">\r
6 <meta name="ProgId" content="FrontPage.Editor.Document">\r
7 <title>Lighting the Terrain</title>\r
8 </head>\r
9 \r
10 <body background="../pics/background.jpg" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">\r
11 \r
12 <b><font SIZE="5">\r
13 <p align="center">Lighting the Terrain</p>\r
14 <div align="right">\r
15   <table border="1" cellspacing="1" width="100%" bordercolor="#808080" bgcolor="#000000" cellpadding="10">\r
16     <tr>\r
17       <td width="100%"><font FACE="Times New Roman">\r
18 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Terrain maps also require some rethinking about the way you light maps.</p>\r
19 </font><b><i><font SIZE="4">\r
20 <p>Vertex Only</p>\r
21 </font></i></b><font FACE="Times New Roman">\r
22 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you are making a large terrain map, you should plan on making your terrain\r
23 textures be lit by vertex lighting only. Lightmaps can quickly become far too\r
24 large for the game to handle.</p>\r
25 <p>Make sure your large terrain textures contain the following parameters:</p>\r
26 <b>\r
27 <p>Surfaceparm nolightmap</b> //signifies vertex lighting only.</p>\r
28 <b>\r
29 <p>Q3map_novertexshadows</b> //this is what keeps those caulk vis blockers from\r
30 causing ugly shadows to form on your terrain.</p>\r
31 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you are using q3map_sun in your sky \85</p>\r
32 <b>\r
33 <p>Q3map_forcesunlight</b> //this makes the light emitted by a q3map_sun\r
34 parameter affect the vertex lit surface.</p>\r
35 </font><b><i><font SIZE="4">\r
36 <p>Light Sources</p>\r
37 </font></i></b><font FACE="Times New Roman">\r
38 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For outdoor maps, the obvious source of lighting ought to be the sky. The\r
39 skies in the mpterra maps began with skies used in more conventional Team Arena\r
40 maps, but were modified to better suit the needs of the terrain worlds.</p>\r
41 <blockquote>\r
42   <blockquote>\r
43   </font><font FACE="Symbol" SIZE="2">\r
44   <p>· </font><b><font FACE="Times New Roman">Slow Down Those Clouds.</font></b><font FACE="Times New Roman">\r
45   One thing to consider is slowing down the rate of cloud movement. What looks\r
46   OK in smaller maps looks wrong in vast panoramas.</p>\r
47   </font><b><font FACE="Symbol" SIZE="2">\r
48   <p>· </font><font FACE="Times New Roman" color="#FFFFFF">Strong Sunlight is\r
49   Good.</font></b><font FACE="Times New Roman" color="#FFFFFF"> For team maps,\r
50   you want to try and keep the light relatively the same in both base areas, so\r
51   if you have mountains or large base structures, having the light come in at a\r
52   nearly vertical angle is good, but less dramatic.\r
53   </font></p>\r
54   <b><font FACE="Symbol" SIZE="2">\r
55   <p><font color="#FFFFFF">· </font> </font><font FACE="Times New Roman">Ambient Light is Not\r
56   So Bad.</font></b><font FACE="Times New Roman" color="#FFFFFF"> Since the\r
57   beginning of Q3A map development we\92ve said things like \93Ambient Lighting\r
58   is bad\94. Well, the problems caused by ambient lighting are still there\r
59   (flattening of shadows and colors), but with the distance of the play areas\r
60   from the sky surface (in some maps), adding an ambient really helps bring up\r
61   the overall light value in the map. Start low, maybe around an ambient value\r
62   of 5 and creep upwards until the map looks right. It is VERY IMPORTANT that\r
63   you give your ambient light a color. If you leave it white, you get ugly pink\r
64   light instead of white. Even specifying white makes it look wrong. Best\r
65   suggestion is to sample the sky texture color and translate that into an rgb\r
66   formula for your ambient. One warning\r
67   though \85 if you include \93interior spaces\94 in your maps, the ambient\r
68   light will affect those areas too. You will not get the deep dark shadows you\r
69   may want in there.\r
70 </font></p>\r
71 <font FACE="Symbol" SIZE="2">\r
72   <p><font color="#FFFFFF">· </font> </font><font color="#FFFFFF"><b><font FACE="Times New Roman">Sky Shader Trick #1: Lose the\r
73   Backsplash</font></b></font><font FACE="Times New Roman"><font color="#FFFFFF">. The attributes of the sky\r
74   shader can have a significan</font>t effect on the amount of time it takes to perform\r
75   a light compile on a map. You have to think of the sky as a huge area light.\r
76   However, unlike light emitting textures (like your average light fixture), the\r
77   sky doesn\92t need to be illuminated itself. Therefore, you can eliminate the\r
78   backsplash light feature which is the default status of the q3map_surfacelight\r
79   parameter. Your sky shader should have the parameter q3map_backsplash with a\r
80   value of -1. Removing backsplash light doesn\92t affect the appearance of the\r
81   sky, but does remove a significant amount of compiling overhead when the\r
82   -light algorithm is used (the normal way you light things).</p>\r
83   </font><font FACE="Symbol" SIZE="2">\r
84   <p>· </font><b><font FACE="Times New Roman">Sky Shader Trick#2: Big\r
85   Subdivisions.</font></b><font FACE="Times New Roman"> Q3Map automatically\r
86   subdivides the sky into triangle quads. The more triangle quads, the more\r
87   light emitting surfaces you have on your sky (if q3map_surfacelight is used).\r
88   The light compile calculates for every one of these light emitting surfaces.\r
89   Increase the size of the subdivision and you get less light emitters and a\r
90   faster compile.</p>\r
91   </font><font FACE="Symbol" SIZE="2">\r
92   <p>· </font><b><font FACE="Times New Roman">Sky Shader Trick #3: -V-light.</font></b><font FACE="Times New Roman">\r
93   This is a fast lighting algorithm. It\92s especially fast for calculating sky\r
94   lighting. It loses a little precision, but it can greatly speed up the time it\r
95   takes to light a map. Even if you decide to use a normal light operation for\r
96   your final map, using -vlight for interim compiles can mean a lot less time\r
97   spent waiting on the compiler to see your results.</p>\r
98   <b>\r
99   <p>&nbsp;</p>\r
100   </blockquote>\r
101   </blockquote>\r
102 </b></font><b><i><font SIZE="4">\r
103 <p>The Light Grid</p>\r
104 </font></i></b><font FACE="Times New Roman">\r
105 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is discussed in detail under terrain-related Worldspawn features. One of\r
106 the things that can add enough memory complexity to a large terrain map, enough\r
107 to make it unplayable (read crash the game), is the light grid. Think of the\r
108 light grid as a map for determining how to light entities in the world. It\92s\r
109 what makes player models appear to move in and out of shadows as they move\r
110 through the world. It\92s a nice effect, but costly in memory terms. For the\r
111 largest maps in Q3:TA, we \93traded down\94 to a less detailed light grid.\r
112 Increasing the size of grid subdivisions from 32 units to 256 units did this. We\r
113 experimented with smaller and larger grids and settled on 256 x 256 x 256 as the\r
114 best size. Smaller and the grid became large and unwieldy. Larger (especially on\r
115 the z dimension) and not enough light reached some of the entities.</p>\r
116 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The details of this feature are noted below under Terrain-Related WorldSpawn\r
117 Features.</p>\r
118 </font>\r
119 \r
120 <p align="center"><a href="the_meta_shader.html">Back</a> - <a href="table_of_contents.html">Table\r
121 of Contents</a> - <a href="terrain_related_worldspawn_features.html">Terrain\r
122 Worldspawn Features</a></p>\r
123 \r
124   <p>&nbsp;</td>\r
125     </tr>\r
126   </table>\r
127 </div>\r
128 </font></b>\r
129 <p>&nbsp;</p>\r
130 <p>&nbsp;</p>\r
131 <p align="center">-22-</p>\r
132 \r
133 </body>\r
134 \r
135 </html>\r