Add parallel compiler

This commit is contained in:
schmelczerandras 2020-09-17 16:04:09 +02:00
parent adbd933955
commit 36c64554f5
14 changed files with 260 additions and 181 deletions

View file

@ -12,6 +12,7 @@ out vec2 uvCoordinates;
uniform vec2 squareToAspectRatio;
#ifdef CIRCLE_LIGHT_COUNT
#if CIRCLE_LIGHT_COUNT > 0
uniform struct CircleLight {
vec2 center;
@ -21,7 +22,9 @@ uniform vec2 squareToAspectRatio;
out vec2[CIRCLE_LIGHT_COUNT] circleLightDirections;
#endif
#endif
#ifdef FLASHLIGHT_COUNT
#if FLASHLIGHT_COUNT > 0
uniform struct Flashlight {
vec2 center;
@ -32,6 +35,7 @@ uniform vec2 squareToAspectRatio;
out vec2[FLASHLIGHT_COUNT] flashlightDirections;
#endif
#endif
void main() {
vec3 vertexPosition2D = vec3(vertexPosition.xy, 1.0) * modelTransform;
@ -44,15 +48,19 @@ void main() {
0.0, 0.0, 1.0
)).xy;
#ifdef CIRCLE_LIGHT_COUNT
#if CIRCLE_LIGHT_COUNT > 0
for (int i = 0; i < CIRCLE_LIGHT_COUNT; i++) {
circleLightDirections[i] = circleLights[i].center - position;
}
#endif
#endif
#ifdef FLASHLIGHT_COUNT
#if FLASHLIGHT_COUNT > 0
for (int i = 0; i < FLASHLIGHT_COUNT; i++) {
flashlightDirections[i] = flashlights[i].center - position;
}
#endif
#endif
}