Closed neomonkeus closed 2 years ago
The frag shader here is missing the light intensity
Based on the the book here - https://ahbejarano.gitbook.io/lwjglgamedev/chapter10#specular-component specularColour ∗ lColour ∗ reflectance ∗ specularFactor ∗ intensity
specularColour ∗ lColour ∗ reflectance ∗ specularFactor ∗ intensity
even though it later also provides the following sample code. specColour = speculrC * specularFactor * material.reflectance * vec4(light.colour, 1.0);
specColour = speculrC * specularFactor * material.reflectance * vec4(light.colour, 1.0);
The function is later corrected in chaper 11 where common functionality is refactored out for calculating the components for Point + Directional lights. https://github.com/lwjglgamedev/lwjglbook-bookcontents/blob/266d58d8270be6f29ab19ee3ac6f22f19ab16d40/chapter11/chapter11.md?plain=1#L162
Thanks!
The frag shader here is missing the light intensity
Based on the the book here - https://ahbejarano.gitbook.io/lwjglgamedev/chapter10#specular-component
specularColour ∗ lColour ∗ reflectance ∗ specularFactor ∗ intensity
even though it later also provides the following sample code.
specColour = speculrC * specularFactor * material.reflectance * vec4(light.colour, 1.0);
The function is later corrected in chaper 11 where common functionality is refactored out for calculating the components for Point + Directional lights. https://github.com/lwjglgamedev/lwjglbook-bookcontents/blob/266d58d8270be6f29ab19ee3ac6f22f19ab16d40/chapter11/chapter11.md?plain=1#L162