• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * a_attributes.glsl: Include this file at the top of your vertex shader, to have all available attributes declared.
3 */
4
5/**
6 * Declare the attributes the Shader provides to us, either using the mesh or a default value (it's up to the Shader to decide that).
7 * We explicitly declare them only when the flag is set for two reasons:
8 * 1. So you can't accidently use an attribute which isn't set by the shader.
9 * 2. The shader might choose a different implementation when an attribute is actually used or not.
10 */
11#include ":a_position"
12#include ":a_color"
13#include ":a_normal"
14#include ":a_tangent"
15#include ":a_binormal"
16#include ":a_texCoords"
17#include ":a_boneWeights"
18
19[a_position]
20#ifdef positionFlag
21 	attribute vec3 a_position;
22#endif //positionFlag
23
24[a_color]
25#ifdef colorFlag
26 	attribute vec4 a_color;
27#endif //colorFlag
28
29[a_normal]
30#ifdef normalFlag
31 	attribute vec3 a_normal;
32#endif //normalFlag
33
34[a_tangent]
35#ifdef tangentFlag
36 	attribute vec3 a_tangent;
37#endif //tangentFlag
38
39[a_binormal]
40#ifdef binormalFlag
41 	attribute vec3 a_binormal;
42#endif //binormalFlag
43
44[a_texCoords]
45#include ":a_texCoord0"
46#include ":a_texCoord1"
47#include ":a_texCoord2"
48#include ":a_texCoord3"
49#include ":a_texCoord4"
50#include ":a_texCoord5"
51#include ":a_texCoord6"
52#include ":a_texCoord7"
53
54[a_texCoord0]
55#ifdef texCoord0Flag
56	#ifndef texCoordsFlag
57		#define texCoordsFlag
58	#endif
59 	attribute vec2 a_texCoord0;
60#endif
61
62[a_texCoord1]
63#ifdef texCoord1Flag
64	#ifndef texCoordsFlag
65		#define texCoordsFlag
66	#endif
67 	attribute vec2 a_texCoord1;
68#endif
69
70[a_texCoord2]
71#ifdef texCoord2Flag
72	#ifndef texCoordsFlag
73		#define texCoordsFlag
74	#endif
75 	attribute vec2 a_texCoord2;
76#endif
77
78[a_texCoord3]
79#ifdef texCoord3Flag
80	#ifndef texCoordsFlag
81		#define texCoordsFlag
82	#endif
83 	attribute vec2 a_texCoord3;
84#endif
85
86[a_texCoord4]
87#ifdef texCoord4Flag
88	#ifndef texCoordsFlag
89		#define texCoordsFlag
90	#endif
91 	attribute vec2 a_texCoord4;
92#endif
93
94[a_texCoord5]
95#ifdef texCoord5Flag
96	#ifndef texCoordsFlag
97		#define texCoordsFlag
98	#endif
99 	attribute vec2 a_texCoord5;
100#endif
101
102[a_texCoord6]
103#ifdef texCoord6Flag
104	#ifndef texCoordsFlag
105		#define texCoordsFlag
106	#endif
107 	attribute vec2 a_texCoord6;
108#endif
109
110[a_texCoord7]
111#ifdef texCoord7Flag
112	#ifndef texCoordsFlag
113		#define texCoordsFlag
114	#endif
115 	attribute vec2 a_texCoord7;
116#endif
117
118[a_boneWeights]
119#include ":a_boneWeight0"
120#include ":a_boneWeight1"
121#include ":a_boneWeight2"
122#include ":a_boneWeight3"
123#include ":a_boneWeight4"
124#include ":a_boneWeight5"
125#include ":a_boneWeight6"
126#include ":a_boneWeight7"
127
128[a_boneWeight0]
129#ifdef boneWeight0Flag
130	#ifndef boneWeightsFlag
131		#define boneWeightsFlag
132	#endif
133 	attribute vec2 a_boneWeight0;
134#endif //boneWeight0Flag
135
136[a_boneWeight1]
137#ifdef boneWeight1Flag
138	#ifndef boneWeightsFlag
139		#define boneWeightsFlag
140	#endif
141	attribute vec2 a_boneWeight1;
142#endif //boneWeight1Flag
143
144[a_boneWeight2]
145#ifdef boneWeight2Flag
146	#ifndef boneWeightsFlag
147		#define boneWeightsFlag
148	#endif
149	attribute vec2 a_boneWeight2;
150#endif //boneWeight2Flag
151
152[a_boneWeight3]
153#ifdef boneWeight3Flag
154	#ifndef boneWeightsFlag
155		#define boneWeightsFlag
156	#endif
157	attribute vec2 a_boneWeight3;
158#endif //boneWeight3Flag
159
160[a_boneWeight4]
161#ifdef boneWeight4Flag
162	#ifndef boneWeightsFlag
163		#define boneWeightsFlag
164	#endif
165	attribute vec2 a_boneWeight4;
166#endif //boneWeight4Flag
167
168[a_boneWeight5]
169#ifdef boneWeight5Flag
170	#ifndef boneWeightsFlag
171		#define boneWeightsFlag
172	#endif
173	attribute vec2 a_boneWeight5;
174#endif //boneWeight5Flag
175
176[a_boneWeight6]
177#ifdef boneWeight6Flag
178	#ifndef boneWeightsFlag
179		#define boneWeightsFlag
180	#endif
181	attribute vec2 a_boneWeight6;
182#endif //boneWeight6Flag
183
184[a_boneWeight7]
185#ifdef boneWeight7Flag
186	#ifndef boneWeightsFlag
187		#define boneWeightsFlag
188	#endif
189	attribute vec2 a_boneWeight7;
190#endif //boneWeight7Flag
191