diff options
Diffstat (limited to '')
-rw-r--r-- | res/images/container_specular.png | bin | 0 -> 144081 bytes | |||
-rw-r--r-- | res/shaders/colors.fs | 4 |
2 files changed, 2 insertions, 2 deletions
diff --git a/res/images/container_specular.png b/res/images/container_specular.png new file mode 100644 index 0000000..681bf6e --- /dev/null +++ b/res/images/container_specular.png Binary files differdiff --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); |