22
33#include "terminalvelocitycabbage: materials.frag";
44#include "terminalvelocitycabbage: lights_base.frag";
5- #include "terminalvelocitycabbage: point_lights.frag";
6- #include "terminalvelocitycabbage: spot_lights.frag";
75#include "terminalvelocitycabbage: directional_lights.frag";
86
97in vec2 vertTextureCoord;
@@ -12,13 +10,6 @@ in vec3 vertVertexPosition;
1210
1311out vec4 fragColor;
1412
15- const int MAX_POINT_LIGHTS = 256 ;
16- const int MAX_SPOT_LIGHTS = 256 ;
17-
18- uniform int pointLightsNum;
19- uniform PointLight pointLights[MAX_POINT_LIGHTS];
20- uniform int spotLightsNum;
21- uniform SpotLight spotLights[MAX_SPOT_LIGHTS];
2213uniform DirectionalLight directionalLight;
2314
2415void main() {
@@ -27,16 +18,6 @@ void main() {
2718 // the color of the fragment multiplied by the ambient light
2819 vec4 color = materialAmbientColor * vec4 (ambientLight, 1 );
2920 color += calcDirectionalLight(directionalLight, vertVertexPosition, vertVertexNormal);
30- for (int i = 0 ; i < pointLightsNum; i++ ) {
31- if (pointLights[i].intensity > 0 ) {
32- color += calcPointLight(pointLights[i], vertVertexPosition, vertVertexNormal);
33- }
34- }
35- for (int i = 0 ; i < spotLightsNum; i++ ) {
36- if (spotLights[i].intensity > 0 ) {
37- color += calcSpotLight(spotLights[i], vertVertexPosition, vertVertexNormal);
38- }
39- }
4021 if (color.a == 0 ) {
4122 discard ;
4223 } else {
0 commit comments