Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Define NameExampleCompatibilityNotes

#version 300 es

precision highp float;


MobileIf mobile this will be defined (open GL version etc.)

#version 330 core

#define mediump

#define lowp

#define highp


Non-MobileIf not mobile this will be defined (open GL version etc.)

#define MAX_NUM_LIGHTS

3
Same as the client setting for Maximum Number of Lights

#define MAX_NUM_BONES

64
This can vary across some versions but now is standardised to 64.

#define GAMMA_CORRECTION

1 or 0
Gamma Correction game setting on/off

#define FRAGMENT_LIGHTING

1 or 0
Fragment Lighting game setting on/off

#define SHADER_QUALITY_MODE

0, 1 or 2
Shader quality mode game setting (low, medium, high)

#define KEYHOLING_ENABLED

1 or 0
Keyholing game setting on/off

#define SHADER_DEBUG_MODE

1 or 0
Shader debug mode on/off

#define BUILD_VERSION

8193

This is very unlikely to change for MP servers - since the server version must match the client version - but can perhaps matter for SP modules if they want to support older versions.

You can still safely use this with the BUILD_REVISION to get a more accurate picture.

#define BUILD_REVISION

35
This is the incremental patch number at the end of the patch version. Omits the last part, eg: 1.87.8193.35.5 won't show the 5, just be "35"

#define NO_DISCARD

1 or 0
Discard enabled or not

#define POSTPROCESSING_TYPES_ENABLED

Bitmask value

See inc_postpr.shd for the bitmask values below. If 0 none are enabled. If post-processing is enabled (either the default-on option to enable post-processing shaders regardless of them being enabled, or one or more is enabled) the vsfbpostpr and fsfbpostpr shader files are run.

Code Block
#define POSTPROCESSING_SHARPEN                  0x0001
#define POSTPROCESSING_DOF                      0x0002
#define POSTPROCESSING_DYNAMIC_CONTRAST         0x0004
#define POSTPROCESSING_VIBRANCE                 0x0008
#define POSTPROCESSING_GAMMA                    0x0010
#define POSTPROCESSING_TOON                     0x0020

Note for some things it simply runs additional shader files explicitly;

  • SSAO: vsFBSSAO, fsFBSSAO
  • Bloom: vsFBBLOOOM, fsFBBLOOM

#define varying

out or in
out = is the for types GL_VERTEX_SHADER and in = not vertex shader

#define attribute

in

#define texture2D

texture

#define textureCube

texture

#define gl_FragColor compat_glFragColor

out vec4 compat_glFragColor;



Only added if a fragment shader

...