Darkplaces material system

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "== Introduction == Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This artic...")
 
m
 
(227 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
+
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This reference contains all information needed to work with Darkplaces materials.
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces.
+
  
=== What is a Material? ===
+
Since Darkplaces material system are inspired by [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader System] and Blood Omnicide is using [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] to build maps, this reference is based on Quake 3/Q3map2 docs, but adapted and extended to Darkplaces way-of-things-done.
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.
+
  
For Darkplaces, Shader scripts are located in 'Path_To_The_Game/gamedir/scripts'.
+
== Chapters ==
 +
<font size=3>
 +
#[[Darkplaces material system/Introduction | Introduction]]
 +
#[[Darkplaces material system/Key Concepts | Key Concepts]]
 +
#[[Darkplaces material system/General Keywords | General Keywords]]
 +
#[[Darkplaces material system/Special Keywords | Special Keywords]]
 +
#[[Darkplaces material system/Stages | Stages]]
 +
</font>
  
A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces ("{" and "}"). Below you can see a simple example of syntax and format for a single process, including the Q3MAP keywords or "Surface Parameters", which follow the first bracket and a single bracketed "stage":
+
__NOTOC__
 
+
[[Category:Darkplaces engine]]
// material definition
+
{{finished}}
textures/mymaterial
+
{
+
    // parameters
+
    qer_editorImage radiant/textures/mymaterial
+
    q3map_textureImage radiant/textures/mymaterial
+
    dpglossexponentmod 0.5
+
    surfaceparm stone
+
    // base stage
+
    {
+
        map path/to/texture
+
    }
+
    // lighting stage
+
    {
+
        map $lightmap
+
    }
+
}
+
 
+
=== Inspired by Quake 3 ===
+
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.
+

Latest revision as of 21:57, 20 February 2013

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This reference contains all information needed to work with Darkplaces materials.

Since Darkplaces material system are inspired by Quake 3 Shader System and Blood Omnicide is using Q3Map2 to build maps, this reference is based on Quake 3/Q3map2 docs, but adapted and extended to Darkplaces way-of-things-done.

[edit] Chapters

  1. Introduction
  2. Key Concepts
  3. General Keywords
  4. Special Keywords
  5. Stages

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox