Changes between Version 6 and Version 7 of MaterialSystem


Ignore:
Timestamp:
Apr 15, 2012, 6:25:54 PM (12 years ago)
Author:
Philip Taylor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MaterialSystem

    v6 v7  
     1[[TOC]]
     2
    13The material system contains many components. Artists should just care about telling actors to use appropriate materials, and occasionally creating new material XML files by copying old ones and tweaking the uniforms. Graphical programmers might care about all the various shader files.
    24
     
    243245
    244246Unlike ARB/GLSL shaders, these aren't defined by XML files at all. Instead, a shader technique says e.g. `<pass shader="fixed:model_solid"/>` with the magic "`fixed:`" prefix, and [source:ps/trunk/source/graphics/ShaderProgramFFP.cpp CShaderProgram::ConstructFFP] returns an appropriate hard-coded implementation.
     247
     248== Shader source files ==
     249
     250ARB vertex/fragment program source files have extensions `.vp` and `.fp` in [source:ps/trunk/binaries/data/mods/public/shaders/arb shaders/arb/].
     251GLSL vertex/fragment shader source files have extensions `.vs` and `.fs` in [source:ps/trunk/binaries/data/mods/public/shaders/glsl shaders/glsl/].
     252
     253All source files are passed through a custom preprocessor before being compiled. This recognises basic C preprocessor syntax (`#if`, `#ifdef`, `#define`, etc; unfortunately not `#elif`), and can refer to the defines from all the earlier XML files (passes, techniques, materials, rendering mode, global renderer context, etc).
     254
     255ARB files should start with "`!!ARBfp1.0`" or "`!!ARBvp1.0`". GLSL files should start with "`#version 120`" (GLSL 1.20 is the lowest version we should bother supporting, and corresponds to GLSL ES 1.00 which should be the highest we require).
     256
     257Otherwise they're just standard ARB/GLSL shaders, so refer to standard shader-writing documentation.