From a7a274bfda04a87009788b705a2d90e01b1041c7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 30 Nov 2010 14:22:34 +0000 Subject: Restructured modeling documentation. --- doc/models.html | 345 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 188 insertions(+), 157 deletions(-) (limited to 'doc/models.html') diff --git a/doc/models.html b/doc/models.html index 5a0e270..e0667ba 100644 --- a/doc/models.html +++ b/doc/models.html @@ -3,40 +3,35 @@ - Project::OSiRiON - Creating models + Project::OSiRiON - Creating 3D models

- The engine supports two kind of models: The first one are - Quake 3 style .map files with custom entities, the second - one are .ase models. Textures are supported, but no advanced - features like normal maps. -

-

- The .map format allows for a quick and easy way to create usable - 3D models, while the .ase format allows importing more complex - models made with modelling packages. The .map format is also used - as a container format to place model tags like lights, - particle effects and weapon locations. -

-

- .ase models can be loaded as sub-models into a .map file, - making modular spaceship design possible. Ship parts like engines - can be placed into seperate files and reused in other models. -

-

- The rest of the document describes how to create models using - Radiant and contains mostly information specific to creating - models for Project::OSiRiON. Even if you can handle Radiant, - it is still worth a read. + 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 (.ase files) and the Quake 3 + map format (.map files). +

+ 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. +

+ 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 misc_model entity) and add Project::OSiRiON-specific + entities like lights, engine flares and weapon locations. +

+ The engine uses submodel instancing making it possible to re-used + submodels with a minimal performace impact.

@@ -47,22 +42,152 @@

+ + +
+ Textures and Materials +
+
+

+ 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. +

+ The file materials/shaderlist.txt contains a list of shader files + that can be used by the engine. Each shader file can contain several materials. +

+ The default shaderlist.txt looks like this: +

+
+common
+colors
+glass
+kuroto
+
+

+ On startup, the engine will read materials from the files materials/common.shader + and materials/colors.shader. 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. +

+ 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. +

+ The materials in the colors/ directory can be used to + draw brush faces with a specified color. The actual RGB color is defined + by the material script. Examples are red, + green and blue. +

+ The default set of colors is rather limited, more colors can be added by + using the common/ family of materials. The actual in-game + color information for these faces will be provided by the engine. +

+ The common/entity 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 common/entity_second represents the secondary + color of an entity. common/entity_third will be a mix of the primary and secondary color. + Each of these materials also has a _dark variant. +

+ There are two special material that will cause the brush faces to be ignored + by the engine: as explained above, the common/caulk material can be used + on hidden faces. The common/clip material is reserved for future use + brush faces using this texture will be ignored as well. +

+ For .ase models, the material name inside the .ase file is interpreted as an osirion material. + If you'd use a material called common/entity, 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 ase material name is used, not the name of the diffuse texture + used by that material. +

+ If a model material has no special definition, the engine will try to load the texture with the same name, + like the material models/cargo/crate/crate. +

+ + +
+ Shader files +
+
+

+ 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. +

+

+ for example, the definition of the textures/common/caulk material: +

+
+// material name
+textures/common/caulk
+{
+    // image used by the map editor
+    qer_editorimage textures/common/caulk.tga
+    // polygons using this material are ignored
+    ignore
+}
+
+

+ This material has the name textures/common/caulk, + 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 common/caulk texture + (note that Radiant doesn't show the textures/ prefix). For .ase files, + it means every triangle with a material that is called textures/common/caulk. +

+

+ This material has the ignore flag: model geometry with this material will simply + be ignored. +

+

+ A second example is the textures/common/entity material: +

+
+// material name
+textures/common/entity
+{
+    // image used by the map editor
+    qer_editorimage textures/common/entity.tga
+    // use entity color
+    entity
+}
+
+

+ This material has the entity flag set: it means model geometry with this material + will be rendered in entity color. For spaceship this means player color. +

+
+// 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
+}
+
+
+
Creating models with Radiant @@ -80,7 +205,7 @@ http://ingar.satgnu.net/gtkradiant. Note that it does not include the Project::OSiRiON support files by default.

- This document will not explain how to use the editor. Consult google + 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.

@@ -93,7 +218,7 @@

-
+
Brushes and sizes
@@ -111,10 +236,9 @@ might be placed in a system filled with player ships and other objects.

The limits of map coordinates are placed on +/-16384 map units. Placing - brushes outside these bounds will have unpredictable results. The map - will be scaled down to make 1024 units in radiant correspond to 1 game unit. - One game unit corresponds to 100m in-game. 16 units in radiant will - therefor correspond to 1.5625 meters in-game. + 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.

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 @@ -123,7 +247,7 @@
-
+
Caulk
@@ -138,7 +262,7 @@
-
+
Clip
@@ -150,7 +274,7 @@
-
+
Detail brushes
@@ -171,112 +295,7 @@
-
- Textures and Materials -
-
-

- 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 use special textures like player and engine color, - or to apply certain effects to a texture. -

- The file materials/shaderlist.txt contains a list of shader files - that can be used by the engine. Each shader file can contain several materials. -

- The default shaderlist.txt looks like this: -

-
-common
-colors
-glass
-
-

- On startup, the engine will read materials from the files materials/common.shader - and materials/colors.shader. 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. -

- 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. -

- The materials in the colors/ directory can be used to - draw brush faces with a specified color. The actual RGB color is defined - by the material script. Examples are red, green and blue. -

- The default set of colors is rather limited, more colors can be added by - using the common/ family of materials. The actual in-game - color information for these faces will be provided by the engine. -

- The common/entity 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 common/entity_second represents the secondary - color of an entity. common/entity_third will be a mix of the primary and secondary color. - Each of these materials also has a _dark variant. -

- There are two special material that will cause the brush faces to be ignored - by the engine: as explained above, the common/caulk material can be used - on hidden faces. The common/clip material is reserved for future use - brush faces using this texture will be ignored as well. -

- For .ase models, the material name inside the .ase file is interpreted as an osirion material. - If you'd use a material called common/entity, 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 it is the actual ase material name that is used, not the name of the diffuse texture - used by that material. -

-
- - -
- Shader files -
-
-

- TODO: write a section on shader files. -

-
-// material name
-textures/common/clip
-{
-    // image used by the map editor
-    qer_editorimage textures/common/clip.tga
-    // image transparency in the map editor
-    qer_trans 0.20
-    // polygons using this material are ignored
-    ignore
-}
-
-
-// material name
-textures/common/entity_dark_bright
-{
-    // image used by the map editor
-    qer_editorimage textures/common/entity_dark.tga
-    // use entity color
-    entity
-    // material color
-    color 0.5 0.5 0.5
-    // polygons using this material are rendered fullbright
-    bright
-}
-
-
-// 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
-}
-
-
- - -
+
Lights
@@ -317,7 +336,7 @@ textures/ship/plating_entity
-
+
Flares
@@ -344,7 +363,7 @@ textures/ship/plating_entity
-
+
Particles
@@ -370,7 +389,7 @@ textures/ship/plating_entity
-
+
Function groups
@@ -394,7 +413,7 @@ textures/ship/plating_entity
-
+
Submodels
@@ -404,7 +423,7 @@ textures/ship/plating_entity
-
+
Other entities
@@ -435,7 +454,19 @@ textures/ship/plating_entity
 testmodel maps/colonial/alexandria
 
- +

+ You can load all models referenced by the game at once by executing the r_loadmodels command. + This makes it easy to find missing models, missing textures or to spot other related problems. +

+
+r_loadmodels
+
+

+ Use the list_model command to get a list of currently loaded models: +

+
+list_model
+
-- cgit v1.2.3