So i've been learning OpenGL for a few months and i wrote a simple Engine for the sake of learning and implementing new techniques. I've implemented a considerable amount of stuff like SSAO, HDR, Bloom, Cascaded Shadow Maps, Variance Shadow Maps and so on. I recently started reading up on Physically Based Rendering and i ended up realizing that my knowledge on Lighting itself isn't very good. I live in Sri Lanka and programmers here don't even know what Graphics Programming is, so asking these questions on this forum is my only option.
- What are the Ka, Kd, Ks terms in a usual Blinn-Phong shader? are they Material properties? Because some shaders represent them as floats and some as vec3s. Or is Kd equal to "max(NdotL, 0.0)" and Ks equal to "pow(max(NdotH, 0.0), 32.0)", in which case are they the 'Intensities' of each of them? Or are these 3 terms just constants meant to be controlled by artists?
- In PBR, are the Kd, Ks terms determined using Metallicness and Roughness values? Because i've been reading this article : http://www.codinglabs.net/article_physically_based_rendering_cook_torrance.aspx , and in this it says the sum of Ks and Kd cannot exceed 1.
- I've been trying to implement a Cook-Torrance specular following this article : http://content.gpwiki.org/index.php/D3DBook:(Lighting)_Cook-Torrance but i have some confusion regarding that. Should "pow(max(NdotH, 0.0), 32.0)" be replaced by the "Rs" term from the code on that article? Because when i tried that, the ambient light areas looked pitch black and the specular highlights were all wrong.
- Why does the Cook-Torrance shader in the CodingLabs article use multiple samples while the GPWiki article does not? Is it to accurately represent the distribution of light?
...and i think that's all the questions off the top of my head. Really sorry if this is a lot, but i'm still a beginner and need a lot of clarification. Anyways i hope you guys and help me out! Thanks in advance!