|
|
@ -101,7 +101,9 @@ float lightComputeSpecular(in vec3 norm, in vec3 viewdir, in vec3 lightdir, in f |
|
|
|
vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ |
|
|
|
vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ |
|
|
|
float diffuseFactor = lightComputeDiffuse(wvNorm, wvLightDir, wvViewDir); |
|
|
|
float diffuseFactor = lightComputeDiffuse(wvNorm, wvLightDir, wvViewDir); |
|
|
|
float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess); |
|
|
|
float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess); |
|
|
|
specularFactor *= step(1.0, m_Shininess); |
|
|
|
|
|
|
|
|
|
|
|
// if shininess is == 0, spec == 0, if shininess > 1, spec == 1 |
|
|
|
|
|
|
|
specularFactor *= min(1.0, m_Shininess); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HQ_ATTENUATION |
|
|
|
#ifdef HQ_ATTENUATION |
|
|
|
float att = clamp(1.0 - g_LightPosition.w * length(lightVec), 0.0, 1.0); |
|
|
|
float att = clamp(1.0 - g_LightPosition.w * length(lightVec), 0.0, 1.0); |
|
|
|