2014-05-12 20:24:26 +00:00
|
|
|
// This file contains common data definitions for both vertex and fragment shader
|
|
|
|
|
2014-07-27 14:09:47 +00:00
|
|
|
// these settings are actually pointless but there seem to be some old ATI drivers that fail to compile the shader without setting the precision here.
|
|
|
|
precision highp int;
|
|
|
|
precision highp float;
|
|
|
|
|
2014-05-12 20:24:26 +00:00
|
|
|
uniform vec4 uCameraPos;
|
2014-07-17 00:37:18 +00:00
|
|
|
uniform int uTextureMode;
|
2016-04-27 00:10:42 +00:00
|
|
|
uniform float uClipHeight, uClipHeightDirection;
|
2015-04-05 18:20:56 +00:00
|
|
|
uniform vec2 uClipSplit;
|
2016-04-28 23:48:06 +00:00
|
|
|
uniform vec4 uClipLine;
|
2014-05-12 20:24:26 +00:00
|
|
|
|
2014-07-14 19:14:43 +00:00
|
|
|
uniform float uAlphaThreshold;
|
2014-07-17 00:37:18 +00:00
|
|
|
|
2014-05-12 20:24:26 +00:00
|
|
|
|
|
|
|
// colors
|
|
|
|
uniform vec4 uObjectColor;
|
2017-01-28 17:19:58 +00:00
|
|
|
uniform vec4 uObjectColor2;
|
2014-05-12 20:24:26 +00:00
|
|
|
uniform vec4 uDynLightColor;
|
|
|
|
uniform vec4 uFogColor;
|
|
|
|
uniform float uDesaturationFactor;
|
2014-06-29 09:00:21 +00:00
|
|
|
uniform float uInterpolationFactor;
|
2014-05-12 20:24:26 +00:00
|
|
|
|
|
|
|
// Fixed colormap stuff
|
|
|
|
uniform int uFixedColormap; // 0, when no fixed colormap, 1 for a light value, 2 for a color blend, 3 for a fog layer
|
|
|
|
uniform vec4 uFixedColormapStart;
|
|
|
|
uniform vec4 uFixedColormapRange;
|
|
|
|
|
|
|
|
// Glowing walls stuff
|
|
|
|
uniform vec4 uGlowTopPlane;
|
|
|
|
uniform vec4 uGlowTopColor;
|
|
|
|
uniform vec4 uGlowBottomPlane;
|
|
|
|
uniform vec4 uGlowBottomColor;
|
|
|
|
|
2015-04-05 18:20:56 +00:00
|
|
|
uniform vec4 uSplitTopPlane;
|
|
|
|
uniform vec4 uSplitBottomPlane;
|
|
|
|
|
2014-05-12 20:24:26 +00:00
|
|
|
// Lighting + Fog
|
|
|
|
uniform vec4 uLightAttr;
|
|
|
|
#define uLightLevel uLightAttr.a
|
|
|
|
#define uFogDensity uLightAttr.b
|
|
|
|
#define uLightFactor uLightAttr.g
|
|
|
|
#define uLightDist uLightAttr.r
|
|
|
|
uniform int uFogEnabled;
|
2017-01-24 18:44:12 +00:00
|
|
|
uniform int uPalLightLevels;
|
2014-05-12 20:24:26 +00:00
|
|
|
|
|
|
|
// dynamic lights
|
2014-08-01 18:59:39 +00:00
|
|
|
uniform int uLightIndex;
|
2014-05-12 20:24:26 +00:00
|
|
|
|
2016-08-22 12:00:25 +00:00
|
|
|
// quad drawer stuff
|
|
|
|
#ifdef USE_QUAD_DRAWER
|
|
|
|
uniform mat4 uQuadVertices;
|
|
|
|
uniform mat4 uQuadTexCoords;
|
|
|
|
uniform int uQuadMode;
|
|
|
|
#endif
|
|
|
|
|
2014-07-14 19:14:43 +00:00
|
|
|
// matrices
|
2014-07-13 21:13:40 +00:00
|
|
|
uniform mat4 ProjectionMatrix;
|
|
|
|
uniform mat4 ViewMatrix;
|
2014-07-13 18:41:20 +00:00
|
|
|
uniform mat4 ModelMatrix;
|
2016-10-03 14:09:32 +00:00
|
|
|
uniform mat4 NormalViewMatrix;
|
|
|
|
uniform mat4 NormalModelMatrix;
|
2014-07-13 18:41:20 +00:00
|
|
|
uniform mat4 TextureMatrix;
|
2014-05-12 20:24:26 +00:00
|
|
|
|