fix: forgot to square something

This commit is contained in:
Laureηt 2022-04-14 13:33:44 +02:00
parent 047b613e03
commit aa3c813795
No known key found for this signature in database
GPG key ID: D88C6B294FD40994

View file

@ -85,7 +85,7 @@ public class Lighting {
double I_diff = Id * kd * Math.cos(normal.dot(l)); double I_diff = Id * kd * Math.cos(normal.dot(l));
/* specular contribution */ /* specular contribution */
double I_spec = Id * ks * Math.cos(h.dot(normal)); double I_spec = Id * ks * Math.pow(Math.cos(h.dot(normal)), 2);
I += I_diff + I_spec; I += I_diff + I_spec;
} catch (InstantiationException ex) { } catch (InstantiationException ex) {