diff options
author | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-18 12:03:15 +1000 |
---|---|---|
committer | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-18 12:03:15 +1000 |
commit | 4d198fe4f5cbe9e022776bdbd0bd8ec8094c8953 (patch) | |
tree | 4fbbf2feba811ded8923bd964f940f1c71c78c0d /assets/shaders/pbr_textured.frag | |
parent | c3737fff1be704e14a2bada69bbf8a6709c5f670 (diff) |
draw pbr container
Diffstat (limited to 'assets/shaders/pbr_textured.frag')
-rw-r--r-- | assets/shaders/pbr_textured.frag | 8 |
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); |