Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/TODO6
-rw-r--r--doc/models.html55
-rw-r--r--osirion.kdevelop2
-rw-r--r--src/model/material.cc6
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
</H1>
<p>
- 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.
<p>
@@ -139,13 +139,13 @@
<p>
<h2 id="materials">
- Materials
+ Textures and Materials
</h2>
<p>
- 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.
</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.
@@ -155,11 +155,13 @@
<pre>
common
colors
+glass
</pre>
<p>
On startup, the engine will read materials from the files <i>materials/common.shader</i>
- and <i>materials/colors.shader</i>. If a model contains an unknown material,
- a warning will be given and the brushes will be colored hot pink.
+ and <i>materials/colors.shader</i>. 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
@@ -192,6 +194,43 @@ colors
<p>
TODO: write a section on shader files.
</p>
+<pre>
+// 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
+}
+</pre>
+<pre>
+// 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
+}
+</pre>
+<pre>
+// 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
+}
+</pre>
+
<h2 id="lights">
Lights
</h2>
diff --git a/osirion.kdevelop b/osirion.kdevelop
index 4872ec6..65328ac 100644
--- a/osirion.kdevelop
+++ b/osirion.kdevelop
@@ -21,7 +21,7 @@
</general>
<kdevautoproject>
<general>
- <activetarget>src/game/base/libbase.la</activetarget>
+ <activetarget>src/model/libmodel.la</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
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) {