From 83b66522dfcad1b2428ce4fd81d83e39a051a4c5 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 12 Aug 2009 15:48:03 +0000 Subject: documentation update --- doc/TODO | 6 +++++- doc/models.html | 55 +++++++++++++++++++++++++++++++++++++++++++-------- osirion.kdevelop | 2 +- src/model/material.cc | 6 +++++- 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/doc/TODO b/doc/TODO index 5ad8b2a..1ea2a02 100644 --- a/doc/TODO +++ b/doc/TODO @@ -30,12 +30,16 @@ version 0.3.0: filesystem: write a filesystem based on streams write handlers for zip + write handlers for gz fs_homedir, to define the writeable directory fs_datadir, readonly package datadir fs_base, fs_mod, fs_game, to be used by modules model: - shaders + read .ase material name + correct .map texture scaling issues + import .ase models into .map files (+submodel instancing) (ok, misc_model) + correct misc_model position issue when importing .map files core: BUG dedicated server does not show chat messages diff --git a/doc/models.html b/doc/models.html index 503408b..68026f4 100644 --- a/doc/models.html +++ b/doc/models.html @@ -10,7 +10,7 @@ The Osirion Project - Creating models

- The engine supports loading of Quake 2 .map files with custom osirion + The engine supports loading of Quake 3 style .map files with custom osirion entities. While it might look like a weird choice for a file format it has been a well-considered pragmatic choice.

@@ -139,13 +139,13 @@

- Materials + Textures and Materials

- While the engine does support several image file formats, it does not - support textured models. Instead the model brushes will be rendered - using plain colors. The engine uses a material system similar to Quake 3 Arena - shader files, to provide an easy way to apply the different colors. + The engine can use tga, jpg and tng 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. @@ -155,11 +155,13 @@

 common
 colors
+glass
 

On startup, the engine will read materials from the files materials/common.shader - and materials/colors.shader. If a model contains an unknown material, - a warning will be given and the brushes will be colored hot pink. + 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 @@ -192,6 +194,43 @@ colors

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/stripes
+{
+    // use entity color
+    entity
+    // use a texture, texture name and material name don't have to be the same
+    texture textures/ship/stripes
+}
+
+

Lights

diff --git a/osirion.kdevelop b/osirion.kdevelop index 4872ec6..65328ac 100644 --- a/osirion.kdevelop +++ b/osirion.kdevelop @@ -21,7 +21,7 @@ - src/game/base/libbase.la + src/model/libmodel.la debug diff --git a/src/model/material.cc b/src/model/material.cc index f9f330d..416e491 100644 --- a/src/model/material.cc +++ b/src/model/material.cc @@ -80,6 +80,8 @@ void Material::init() while (shaderlist.getline(line, 1023)) { if ((line[0] == 0) || (line[0] == '#') || (line[0] == ';')) { continue; + if ((line[0] == '/') && (line[1] == '/')) + continue; } else { std::string s(line); aux::trim(s); @@ -135,8 +137,10 @@ void Material::load_shader(const std::string &shadername) std::string firstword; if (linestream >> firstword) { + if (firstword.compare("//") == 0) { + continue; - if (firstword.compare("}") == 0) { + } else if (firstword.compare("}") == 0) { parselevel--; } else if (firstword.compare("{") == 0) { -- cgit v1.2.3