forked from QW-Group/ezquake-source
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.glsl
121 lines (99 loc) · 1.97 KB
/
common.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// This file included in all .glsl files (inserted at #ezquake-definitions point)
#define MAX_DLIGHTS 32
layout(std140, binding=EZQ_GL_BINDINGPOINT_FRAMECONSTANTS) uniform GlobalState {
mat4 modelViewMatrix;
mat4 projectionMatrix;
vec4 lightPositions[MAX_DLIGHTS];
vec4 lightColors[MAX_DLIGHTS];
vec3 cameraPosition;
int lightsActive;
// drawflat colours
vec4 r_wallcolor;
vec4 r_floorcolor;
vec4 r_telecolor;
vec4 r_lavacolor;
vec4 r_slimecolor;
vec4 r_watercolor;
vec4 r_skycolor;
vec4 v_blend;
float time;
float gamma;
float contrast;
int r_alphatestfont;
// sky
float skySpeedscale;
float skySpeedscale2;
float r_farclip_unused; // Replace
float waterAlpha;
// animated skybox
vec4 skyWind;
// drawflat toggles
int r_drawflat;
int r_fastturb;
int r_fastsky;
int r_textureless;
// [4-byte break]
float r_lerpmodels;
// powerup shells round alias models
float shellSize_unused; // Replace
float shell_base_level1;
float shell_base_level2;
float shell_effect_level1;
float shell_effect_level2;
float shell_alpha;
// lighting
float lightScale;
// [4-byte break]
int r_width;
int r_height;
float r_zFar;
float r_zNear;
// fog parameters
vec3 fogColor;
float fogDensity;
float skyFogMix;
float fogMinZ;
float fogMaxZ;
// camAngles.x
vec3 camAngles; // camAngles.yz
float r_inv_width;
float r_inv_height;
};
struct WorldDrawInfo {
mat4 mvMatrix;
float alpha;
int samplerBase;
int drawFlags;
int padding;
};
struct SamplerMapping {
int sampler;
float layer;
int flags;
};
struct AliasModelVert {
float x, y, z;
float nx, ny, nz;
float dx, dy, dz;
float s, t;
int padding;
};
struct AliasModel {
mat4 modelView;
vec4 color;
vec4 topcolor;
vec4 bottomcolor;
int flags;
float yaw_angle_rad;
float shadelight;
float ambientlight;
int materialTextureMapping;
float lerpFraction;
float minLumaMix;
float outlineNormalScale;
};
struct model_surface {
vec4 normal;
vec3 vecs0;
vec3 vecs1;
};