lwjglgamedev / lwjglbook-leg

Source code of the chapters of the book 3D Game Development with LWJGL 3
https://ahbejarano.gitbook.io/lwjglgamedev/
Apache License 2.0
560 stars 202 forks source link

Question about spotlight reflection handling #16

Closed mudlee closed 7 years ago

mudlee commented 7 years ago

Hi!

I'm just wondering that in the tutorial, directional- and pointligths are handling the material reflectivity in the fragment shader as I expected. My question is: why the spotlight calculation does not? So if I light an object with only a spotlight, it does not matter how reflective it is?

Thanks.

BTW, this tutorial is a must for people who start learning lwjgl. Cannot say enough, thank you guy(s)! Well written, well done material!

mudlee commented 7 years ago

OK, I'm closing this, after an hour of checking the code I sent this, then - of course - I've found the line I missed in the calcSpotLight method: colour = calcPointLight(light.pl, position, normal);

lwjglgamedev commented 7 years ago

Ok, glad to hear that.