Skip to content

Commit 8974459

Browse files
committed
don't allocate point and spot light uniforms
1 parent 146b84a commit 8974459

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/main/resources/assets/modelviewer/shaders/default.frag

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
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

97
in vec2 vertTextureCoord;
@@ -12,13 +10,6 @@ in vec3 vertVertexPosition;
1210

1311
out 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];
2213
uniform DirectionalLight directionalLight;
2314

2415
void 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

Comments
 (0)