Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: 2725bff8339df284f7cd188c84e562e63d78d62d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="main.css">
	<TITLE>Project::OSiRiON - Creating 3D models</TITLE>
</head>

<body>
<div class="banner">
	<img src="images/banner.png" ALT="Project::OSiRiON">
	<br>
	Creating 3D models
</div>

<div class="text">
<p>
	Like many other games engines, Project::OSiRiON supports the loading of
	object geometry saved as 3D model files. The engine supports
	the ASCII Scene Export format (<span style="fixed">.ase</span> files) and the Quake 3
	map format (<span style="fixed">.map</span> files).
</p><p>
	Modelers using 3D modeling packages like 3D Studio Max or Blender
	can export their creations to the .ase format. Mappers used to
	working with GtkRadiant, NetRadiant or other Quake 3 level editors,
	can use the .map format directly, there is no map compiler involved.
</p><p>
	The .map format can also be used as a container: it is possible
	to import other models as sub-model in a .map file 
	(see the <i>misc_model</i> entity) and add Project::OSiRiON-specific
	entities like lights, engine flares and weapon locations.
</p><p>
	The engine uses submodel instancing making it possible to re-used
	submodels with a minimal performace impact.
</p>
</div>

<div class="title">
	Content
</div>

<div class="text">
<p>
<ul>
	<li><a href="#materials">Textures and Materials</a>
	<ul>
		<li><a href="#shaders_files">Shader files</a>
	</ul>
	<li><a href="#gtkradiant">Creating models with Radiant</a>
	<ul>
		<li><a href="#brushes_and_sizes">Brushes and sizes</a>
		<li><a href="#caulk">Caulk</a>
		<li><a href="#clip">Clip</a>
		<li><a href="#detail_brushes">Detail brushes</a>
		<li><a href="#lights">Lights</a>
		<li><a href="#flares">Flares</a>
		<li><a href="#particles">Particles</a>
		<li><a href="#groups">Function groups</a>
		<li><a href="#submodels">Submodels</a>
		<li><a href="#other_entities">Other entities</a>
	</ul>
	<li><a href="#commands">Useful commands</a>
</ul>
</div>


<!-- =============================================================== -->
<div class="title" id="materials">
	Textures and Materials
</div>
<div class="text">
<p>
	The engine can use TGA, JPEG and PNG images as textures and uses a simple
	script based materials system similar to Quake 3 Arena shader files.
	Materials make it possible to use special textures like player and engine color,
	or to apply certain effects to a texture image.
</p><p>
	The file <i>materials/shaderlist.txt</i> contains a list of shader files
	that can be used by the engine. Each shader file can contain several materials.
</p><p>
	The default shaderlist.txt looks like this:
</p>
<pre class="code">
common
colors
glass
kuroto
</pre>
<p>
	On startup, the engine will read materials from the files <span class="fixed">materials/common.shader</span>
	and <span class="fixed">materials/colors.shader</span>. When loading a .map or .ase file the engine
	will check if a texture name matches a known material. If a match is found,
	the engine will use the settings found in the material script.
</p><p>
	In radiant, the materials can be used as normal textures, like you can with 
	Quake 3 Arena shaders. A number of default materials are already defined 
	and can be used out of the box. 
</p><p>
	The materials in the <span class="fixed">colors/</span> directory can be used to
	draw brush faces with a specified color. The actual RGB color is defined
	by the material script. Examples are <span class="fixed">red</span>,
	<span class="fixed">green</span> and <span class="fixed">blue</span>.
</p><p>
	The default set of colors is rather limited, more colors can be added by 
	using the <span class="fixed">common/</span> family of materials. The actual in-game
	color information for these faces will be provided by the engine.
</p><p>
	The <span class="fixed">common/entity</span> material represents an object's primary color. 
	In-game the faces with this texture will be drawn with the primary color of the entity
	that uses the model. For example, a player's ship will have its owner's color.
	Similar, the material <span class="fixed">common/entity_second</span> represents the secondary
	color of an entity. <span class="fixed">common/entity_third</span> will be a mix of the primary and secondary color.
	Each of these materials also has a <span class="fixed">_dark</span> variant.
</p><p>
	There are two special material that will cause the brush faces to be ignored
	by the engine: as explained above, the <span class="fixed">common/caulk</span> material can be used
	on hidden faces. The <span class="fixed">common/clip</span> material is reserved for future use
	brush faces using this texture will be ignored as well.
</p><p>
	For .ase models, the material name inside the .ase file is interpreted as an osirion material.
	If you'd use a material called  <span class="fixed">common/entity</span>, those model faces will rendered using
	the object's primary in-game color, regardless of the actual material settings in the .ase file.
	Note that the actual <i>ase material name</i> is used, not the name of the diffuse texture
	used by that material.
</p><p>
	If a model material has no special definition, the engine will try to load the texture with the same name,
	like the material <span class="fixed">models/cargo/crate/crate</span>.
</div>

<!-- =============================================================== -->
<div class="subtitle" id="shader_files">
	Shader files
</div>
<div class="text">
<p>
	Shader files contain material definitions: each material is defined by its name,
	and for each material a number of flags can be set to tell the engine how to handle it.
</p>
<p>
	for example, the definition of the <span class="fixed">textures/common/caulk</a> material:
</p>
<pre class=code>
// material name
textures/common/caulk
{
    // image used by the map editor
    qer_editorimage textures/common/caulk.tga
    // polygons using this material are ignored
    ignore
}
</pre>
<p>
	This material has the name <span class="fixed">textures/common/caulk</span>, 
	this means the rules for this material have to be applied to each model face that uses it.
	In Radiant, this means every patch or brush with the <span class="fixed">common/caulk</span> texture
	(note that Radiant doesn't show the <span class="fixed">textures/</span> prefix). For .ase files,
	it means every triangle with a material that is called <span class="fixed">textures/common/caulk</span>.
</p>
<p>
	This material has the <span class="fixed">ignore</span> flag: model geometry with this material will simply
	be ignored.
</p>
<p>
	A second example is the <span class="fixed">textures/common/entity</span> material:
</p>
<pre class=code>
// material name
textures/common/entity
{
    // image used by the map editor
    qer_editorimage textures/common/entity.tga
    // use entity color
    entity
}
</pre>
<p>
	This material has the <span class="fixed">entity</span> flag set: it means model geometry with this material
	will be rendered in entity color. For spaceship this means player color.
</p>
<pre class=code>
// material name
textures/ship/plating_entity
{
    // use entity color
    entity
    // use a texture, texture name and material name don't have to be the same
    texture textures/ship/plating
}
</pre>
</div>

<!-- =============================================================== -->
<div class="title" id="radiant">
	Creating models with Radiant
</div>
<div class="text">
<p>
	The .map models for the game were created with NetRadiant,
	in theory any editor capable of exporting Quake 3 .map files could
	be used. Support for files which can be used with NetRadiant or GtkRadiant 1.5
	are included in the data distribution. Refer to the file INSTALL on where 
	to find them and how to install them. No map compiler is necessary,
	the engine reads the .map files directly.
<p></p>
	You can also use the NetRadiant distribution from
	<a href="http://ingar.satgnu.net/gtkradiant">http://ingar.satgnu.net/gtkradiant</a>.
	Note that it does not include the Project::OSiRiON support files by default.
<p></p>
	This sectio will not explain how to use the editor. Consult google
	for numerous tutorials on this subject. All basic brush editing
	techniques for any Quake-engine based game can be used.
<p></p>
	The main difference with other games is that you are not creating
	a map for a 3d-shoot'em'up, but obviously, an object that has to be
	loaded into a space game.
<p></p>
	Because there is no map compile involved, and the engine is fundamentally
	different, some points should be take under consideration.
</p>
</div>

<div class="subtitle" id="brushes_and_sizes">
	Brushes and sizes
</div>
<div class="text">
<p>
	The engine only supports brushes only, patches will be ignored. A large number
	of complex brushes is supported, but I advise not to go below grid size 1.
	As with any engine it is still possible to create brushwork that gets
	messed up due to rounding errors.
<p></p>
	When the model is loaded, the bounding box is calculated. The model will
	be automaticly centered around the center of the geometry. All visible faces
	will be converted to triangles. At the moment the practical triangle count
	limit for a model is between 20,000 and 30,000 brushes. The engine is
	capable of handling a lot more, but think about the fact that a large station
	might be placed in a system filled with player ships and other objects.
<p></p>
	The limits of map coordinates are placed on +/-16384 map units. Placing
	brushes outside these bounds will have unpredictable results. The engine will
	rescale models as required, therefor the actual size of the map in the editor
	is not that important.
<p></p>
	The front of a model points along the positive X-axis, the positive
	Z-axis is up, the positive Y-axis is left. In Radiant, the nose of
	a spacesip or the front of a spacestation should point to the right.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="caulk">
	Caulk
</div>

<div class="text">
<p>
	Any brush face that has the <i>common/caulk</i> texture will be ignored on load.
	Note that <i>common/caulk</i> is actually a special material with the <i>ignore</i> flag set.
</p>
<p>
	Like in Quake 3 maps, all invisible brushes faces should have the this material.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="clip">
	Clip
</div>
<div class="text">
<p>
	Any brush face that has the <i>common/clip</i> texture will be ignored on load.
	Note that <i>common/clip</i> is actually a special material with the <i>ignore</i> flag set.
	Clip is reserved for future use.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="detail_brushes">
	Detail brushes
</div>
<div class="text">
<p>
	As with other engines, Osirion supports the use of detail brushes, but
	with a twist: detail brushes will only be rendered if the model 
	is within detail range, close enough to the camera. When it is further away, 
	only structural brushes will be rendered.  The actual detail range depends on the
	size of the model.
</p><p>
	This means that any object that could only been seen from close by
	should be made from detail brushes.
</p><p>
	This has one improtant implication: if you show the structural brushes
	only (with the CTRL+D filter in Gtkradiant) there should be no obvious
	gaps of caulk that were previously hidden behind detail brushes.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="lights">
	Lights
</div>
<div class="text">
<p>
	Unlike quake, <i>light</i> entities are not used to add lighting information
	to the level but to add point lights to a model. Adding a light will
	render a light flare texture in the corresponding location.
</p><p>
	The <i>flare</i> value indicates what texture will be used to draw the light.
	The flare value is translated to a texture name, <i>bitmaps/fx/flare??</i>. 
	The default flare texture is <i>flare00</i>.
</p><p>
	The <i>light</i> value is used to determine the size of the flare. The engine
	default is 100, resulting in rather large flares.
</p><p>
	The default <i>_color</i> is white, but the color can be set through radiant's
	color menu (K key). If the <i>entity</i> option (spawnflag 2) is set, the
	color value will be ignored and the light will be rendered with the
	color of the entity it is attached to. 
</p><p>
	The <i>strobe</i> option (spawnflag 1) will create a blinking light. A number
	of options can be set to manipulate the flashing behaviour. By default
	a strobe light will be half a second on, half a second off.
</p><p>
	The <i>frequency</i> value changes the number of flashes per second.
</p><p>
	The <i>offset</i> value changes the moment the light will be on. Offset is
	measured in seconds.
</p><p>
	The <i>time</i> value sets the fraction of time the light will be on. 
	The default is 0.5.
</p><p>
	Lights will only be rendered if the model is within detail range.
</p><p>
	I also came across this usefull information: <a href="http://en.wikipedia.org/wiki/Starboard">http://en.wikipedia.org/wiki/Starboard</a><br>
	In short, the green light should be on the right side, the red light on the left side.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="flares">
	Flares
</div>
<div class="text">
<p>
	The default light entity creates omnidirectional lights. To create
	a directional flare, use the <i>fx_flare</i> entity. Values for a 
	<i>fx_flare</i> are the same as those for a default light, with one
	small diference: the size of the flare is set through the radius
	value. The default flare radius is 100. Rotate the entity or set the
	angle value to point the flare in a different direction.
</p><p>
	Setting the <i>entity</i> option (spawnflag 2) will assign the entities
	primary colour as flare colour.
</p><p>
	Use the <i>engine</i> option (spawnflag 4) to create a flare that
	lights up depending on engine power.
</p><p>
	The direction of the flare can be set with the <i>pitch</i>,
	<i>yaw</i> and <i>roll</i> keys. The <i>angle</i> key is an alias for <i>yaw</i>.
	The <i>angles</i> key allows you to to set pitch, yaw and roll angles in a single key value.
</p><p>
	Flares will only be rendered if the entity is within detail range.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="particles">
	Particles
</div>
<div class="text">
<p>
	Add a <i>fx_particles</i> entity to attach a particle system to the model.
	They can be used to add effects like trails and smoke. A particle system
	must be defined in <i>particles.ini</i> before it can be used.
</p><p>
	The <i>script</i> value must be set to the label of the particles script.
</p><p>
	Setting the <i>entity</i> option (spawnflag 2) will assign the entities
	primary colour as particle system colour.
</p><p>
	Use the <i>engine</i> option (spawnflag 4) will assign the models engine colour
	as particle system colour.
</p><p>
	The axis of the particle system can be set with the <i>pitch</i>,
	<i>yaw</i> and <i>roll</i> keys. The <i>angle</i> key is an alias for <i>yaw</i>.
	The <i>angles</i> key allows you to to set pitch, yaw and roll angles in a single key value.
</p><p>
	Particles will only be rendered if the entity is within detail range.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="groups">
	Function groups
</div>
<div class="text">
<p>
	Brushes can be grouped together into funcion groups. These groups can be used
	to create moving parts in a model.
</p>
<p>
	<i>func_door</i> will be used to create animated doors (not implemented)
</p>
<p>
	<i>func_group</i> an editor utility to group brushes together.
</p>
<p>
	<i>func_rotate</i> will create a rotating set of brushes. The center of the rotation
	is automaticly calculated as the geometrical center of the group.
	The rotation axis can be set with the <i>pitch</i>, <i>yaw</i> and <i>roll</i> keys.
	The <i>angle</i> key is an alias for <i>yaw</i>.
	The <i>angles</i> key allows you to to set pitch, yaw and roll angles in a single key value.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="submodels">
	Submodels
</div>
<div class="text">
<p>
	<i>misc_model</i> can be used to add a submodel.
</p>
</div>

<!-- =============================================================== -->
<div class="subtitle" id="other_entities">
	Other entities
</div>
<div class="text">
<p>
	<i>location_cockpit</i>, <i>location_dock</i>, <i>location_turret</i> and <i>location_cannon</i> are reserved but have not yet been implemented.
</p><p>
	<i>location_cockpit</i> will be used to indicate where the cockpit of a vessel is located
	and will be used to place the camera in cockpit mode.
</p><p>
	<i>location_dock</i> will be used to indicate the location of docking ports.
</p><p>
	<i>location_cannon</i> will create an attachment point for a cannon. Cannons are forward
	shooting guns.
</p><p>
	<i>location_turret</i> will create an attachment point for turrets. Turrets point upwards or downwards.
</p>
</div>

<!-- =============================================================== -->
<div class="title" id="commands">
	Useful commands
</div>
<div class="text">
<p>
	The client has a built-in model viewer, you can view any model
	by executing the <span class="fixed">testmodel<span> command:
</p>
<pre class="code">
testmodel maps/colonial/alexandria
</pre>
<p>
	You can load all models referenced by the game at once by executing the <span class="fixed">r_loadmodels</span> command.
	This makes it easy to find missing models, missing textures or to spot other related problems. 
</p>
<pre class="code">
r_loadmodels
</pre>
<p>
	Use the <span class="fixed">list_model</span> command to get a list of currently loaded models:
</p>
<pre class="code">
list_model
</pre>
</div>

</body>
</html>