From 89744593a917c36ee041270ac85ec17bcf33e9d4 Mon Sep 17 00:00:00 2001 From: Brandon Davis Date: Sun, 28 Feb 2021 11:08:50 -0600 Subject: [PATCH] don't allocate point and spot light uniforms --- .../assets/modelviewer/shaders/default.frag | 19 ------------------- terminal_velocity_engine | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/main/resources/assets/modelviewer/shaders/default.frag b/src/main/resources/assets/modelviewer/shaders/default.frag index 371f051..d9e89fe 100644 --- a/src/main/resources/assets/modelviewer/shaders/default.frag +++ b/src/main/resources/assets/modelviewer/shaders/default.frag @@ -2,8 +2,6 @@ #include "terminalvelocitycabbage:materials.frag"; #include "terminalvelocitycabbage:lights_base.frag"; -#include "terminalvelocitycabbage:point_lights.frag"; -#include "terminalvelocitycabbage:spot_lights.frag"; #include "terminalvelocitycabbage:directional_lights.frag"; in vec2 vertTextureCoord; @@ -12,13 +10,6 @@ in vec3 vertVertexPosition; out vec4 fragColor; -const int MAX_POINT_LIGHTS = 256; -const int MAX_SPOT_LIGHTS = 256; - -uniform int pointLightsNum; -uniform PointLight pointLights[MAX_POINT_LIGHTS]; -uniform int spotLightsNum; -uniform SpotLight spotLights[MAX_SPOT_LIGHTS]; uniform DirectionalLight directionalLight; void main() { @@ -27,16 +18,6 @@ void main() { //the color of the fragment multiplied by the ambient light vec4 color = materialAmbientColor * vec4(ambientLight, 1); color += calcDirectionalLight(directionalLight, vertVertexPosition, vertVertexNormal); - for (int i = 0; i < pointLightsNum; i++) { - if (pointLights[i].intensity > 0) { - color += calcPointLight(pointLights[i], vertVertexPosition, vertVertexNormal); - } - } - for (int i = 0; i < spotLightsNum; i++) { - if (spotLights[i].intensity > 0) { - color += calcSpotLight(spotLights[i], vertVertexPosition, vertVertexNormal); - } - } if (color.a == 0) { discard; } else { diff --git a/terminal_velocity_engine b/terminal_velocity_engine index 3a9fca0..d0004f6 160000 --- a/terminal_velocity_engine +++ b/terminal_velocity_engine @@ -1 +1 @@ -Subproject commit 3a9fca024e5fe0b1d2cf4c76ea08c87f4b4c9b94 +Subproject commit d0004f66322d6907e618a8a491c30fff7c426050