| 247 | |
| 248 | == Shader source files == |
| 249 | |
| 250 | ARB vertex/fragment program source files have extensions `.vp` and `.fp` in [source:ps/trunk/binaries/data/mods/public/shaders/arb shaders/arb/]. |
| 251 | GLSL vertex/fragment shader source files have extensions `.vs` and `.fs` in [source:ps/trunk/binaries/data/mods/public/shaders/glsl shaders/glsl/]. |
| 252 | |
| 253 | All 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 | |
| 255 | ARB 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 | |
| 257 | Otherwise they're just standard ARB/GLSL shaders, so refer to standard shader-writing documentation. |