This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
NFRev1/NothinFancy/assets/base/shaders/lightingVertex.shader
Grayson Riffe (Laptop) b4c704f5ec Basic physics with boxes
2021-10-25 00:40:44 -05:00

20 lines
449 B
GLSL

#version 330 core
layout(location = 0) in vec2 pos;
layout(location = 1) in vec2 texCoords;
uniform mat4 lightSpaceMat[16];
uniform int numMats;
uniform sampler2D gBPos;
out vec2 texCoord;
out vec4 fragPosLightSpace[16];
void main() {
texCoord = texCoords;
vec3 fragPos = texture(gBPos, texCoord).xyz;
for (int i = 0; i < numMats; i++) {
fragPosLightSpace[i] = lightSpaceMat[i] * vec4(fragPos, 1.0);
}
gl_Position = vec4(pos, 0.0, 1.0);
}