Lighting material
* Hopefully fix incorrect parallax map * Multiply specular by diffuse factor to prevent physically impossible shininess (compare TestNormalMapping to understand the difference) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8006 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
17b949fea2
commit
e5be9cef83
@ -125,6 +125,8 @@ vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec3 w
|
|||||||
float att = vLightDir.w;
|
float att = vLightDir.w;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
specularFactor *= diffuseFactor;
|
||||||
|
|
||||||
return vec2(diffuseFactor, specularFactor) * vec2(att);
|
return vec2(diffuseFactor, specularFactor) * vec2(att);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -143,7 +145,7 @@ void main(){
|
|||||||
float heightBias = heightScale * -0.5;
|
float heightBias = heightScale * -0.5;
|
||||||
vec3 normView = normalize(vViewDir);
|
vec3 normView = normalize(vViewDir);
|
||||||
h = (h * heightScale + heightBias) * normView.z;
|
h = (h * heightScale + heightBias) * normView.z;
|
||||||
newTexCoord = texCoord + (h * -normView.xy);
|
newTexCoord = texCoord + (h * normView.xy);
|
||||||
#else
|
#else
|
||||||
newTexCoord = texCoord;
|
newTexCoord = texCoord;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user