summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-26 23:15:22 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-26 23:15:22 +1000
commit2e2c57a8c04575eec164279a49947cfdba250853 (patch)
treeb5d20aa256de40ebd9bad7c59ab1e8ebb1c47b52 /assets
parentf5e5a6fdf58f3135f3211135bfbcb6e70630309f (diff)
scenes and pbr cleanup to handle missing texture of param
Diffstat (limited to 'assets')
-rw-r--r--assets/shaders/pbr_textured.frag13
1 files changed, 9 insertions, 4 deletions
diff --git a/assets/shaders/pbr_textured.frag b/assets/shaders/pbr_textured.frag
index 5353fa7..8148f05 100644
--- a/assets/shaders/pbr_textured.frag
+++ b/assets/shaders/pbr_textured.frag
@@ -21,11 +21,16 @@ uniform Lights {
PointLight pointLights[NUM_POINT_LIGHTS];
} scene;
+uniform PBR_Params {
+ vec3 albedo;
+ float metallic;
+ float roughness;
+ float ao;
+} params;
// Material Textures
uniform sampler2D albedoMap;
uniform sampler2D metallicRoughnessMap;
-// uniform sampler2D roughnessMap;
uniform sampler2D aoMap;
uniform sampler2D normalMap;
@@ -56,9 +61,9 @@ vec3 getNormalFromMap()
void main() {
// vec3 albedo = pow(texture(albedoMap, fragTexCoords).rgb, vec3(2.2));
- vec3 albedo = texture(albedoMap, fragTexCoords).rgb;
- float metallic = texture(metallicRoughnessMap, fragTexCoords).b;
- float roughness = texture(metallicRoughnessMap, fragTexCoords).g;
+ vec3 albedo = params.albedo * texture(albedoMap, fragTexCoords).rgb;
+ float metallic = params.metallic * texture(metallicRoughnessMap, fragTexCoords).b;
+ float roughness = params.roughness * texture(metallicRoughnessMap, fragTexCoords).g;
float ao = texture(aoMap, fragTexCoords).r;
// vec3 norm = normalize(fragNormal); // N