summaryrefslogtreecommitdiff
path: root/assets/shaders/pbr_textured.frag
diff options
context:
space:
mode:
Diffstat (limited to 'assets/shaders/pbr_textured.frag')
-rw-r--r--assets/shaders/pbr_textured.frag8
1 files changed, 5 insertions, 3 deletions
diff --git a/assets/shaders/pbr_textured.frag b/assets/shaders/pbr_textured.frag
index e76a099..5353fa7 100644
--- a/assets/shaders/pbr_textured.frag
+++ b/assets/shaders/pbr_textured.frag
@@ -6,6 +6,8 @@ in vec3 fragWorldPos;
in vec3 fragNormal;
in vec2 fragTexCoords;
+in vec4 viewPos;
+
struct PointLight {
vec4 position;
vec4 color;
@@ -15,11 +17,11 @@ struct PointLight {
// Lights data
#define NUM_POINT_LIGHTS 4
-uniform Scene_Lights {
+uniform Lights {
PointLight pointLights[NUM_POINT_LIGHTS];
- vec4 viewPos;
} scene;
+
// Material Textures
uniform sampler2D albedoMap;
uniform sampler2D metallicRoughnessMap;
@@ -62,7 +64,7 @@ void main() {
// vec3 norm = normalize(fragNormal); // N
vec3 norm = getNormalFromMap();
vec3 N = norm;
- vec3 viewDir = normalize(vec3(scene.viewPos) - fragWorldPos); // V
+ vec3 viewDir = normalize(vec3(viewPos) - fragWorldPos); // V
vec3 V = viewDir;
vec3 F0 = vec3(0.04);