summary refs log tree commit diff
path: root/res/shaders
diff options
context:
space:
mode:
authoriurii <[email protected]>2024-09-07 14:27:01 +0200
committeriurii <[email protected]>2024-09-07 14:27:01 +0200
commite4e90e53f02f6a431422c7790a7df34d396a3c6a (patch)
tree448dc3a12af3d25a63d030976adb41dff37f55d2 /res/shaders
parentc5bf2b9de1504e60c007d3a166beb45c1eab64e9 (diff)
downloadfunhalla-e4e90e53f02f6a431422c7790a7df34d396a3c6a.tar.gz
specular mapping
Diffstat (limited to '')
-rw-r--r--res/shaders/colors.fs4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/shaders/colors.fs b/res/shaders/colors.fs
index a486a92..6a42cbd 100644
--- a/res/shaders/colors.fs
+++ b/res/shaders/colors.fs
@@ -4,7 +4,7 @@ out vec4 FragColor;
 
 struct Material {
   sampler2D diffuse;
-  vec3 specular;
+  sampler2D specular;
   float shininess;
 };
 
@@ -39,7 +39,7 @@ void main() {
   vec3 view_dir = normalize(view_position - FragPos);
   vec3 reflect_dir = reflect(-light_dir, norm);
   float spec = pow(max(dot(view_dir, reflect_dir), 0.0), material.shininess);
-  vec3 specular = light.specular * (spec * material.specular);
+  vec3 specular = light.specular * spec * texture(material.specular, TexCoords).rgb;
 
   vec3 result = ambient + diffuse + specular;
   FragColor = vec4(result, 1.0);