Changes between Version 8 and Version 9 of MaterialSystem


Ignore:
Timestamp:
Apr 15, 2012, 7:12:00 PM (12 years ago)
Author:
Philip Taylor
Comment:

expand on defines

Legend:

Unmodified
Added
Removed
Modified
  • MaterialSystem

    v8 v9  
    5757
    5858== Defines ==
     59
     60Defines can come from many places: first from the engine, and then from `<define>`s inside `<material>`, `<technique>`, `<pass>`, `<program>`, and from `#define` in the source files, in that order. At each stage, conditionals can refer to the defines from all earlier stages. If a name is defined that was already defined in an earlier stage, its value will be overridden. There's no way to undefine a name, but defining it to `0` should have the same effect. (Shader source files should use `#if` instead of `#ifdef` to correctly handle values of `0`.)
     61
     62The system of defines and conditionals can support many different ways to implement desired behaviour: to implement two materials, you could have two different shader effects, or one effect with two techniques, or one technique with conditionals to select two paths through the code. Performance is the same with any of those, so good design requires a judgement call to maximise clarity (avoid code duplication, avoid complex conditionals, etc).
     63
     64Current defines: (this is likely to get outdated, so check the code to verify)
    5965
    6066Set globally by engine code: