Fixed weird specular on hair an teleportation target! Was a stupid mistake...

This commit is contained in:
Olivier Prat 2018-04-19 10:04:38 +02:00
parent 1c9d1f6c48
commit c8bef8651f
5 changed files with 13 additions and 13 deletions

View file

@ -109,6 +109,9 @@ vec4 computeHazeColor(vec4 fragColor, vec3 fragPositionES, vec3 fragPositionWS,
// Convert haze colour from uniform into a vec4
vec4 hazeColor = vec4(hazeParams.hazeColor, 1.0);
// Use the haze colour for the glare colour, if blend is not enabled
vec4 blendedHazeColor;
if ((hazeParams.hazeMode & HAZE_MODE_IS_ENABLE_LIGHT_BLEND) == HAZE_MODE_IS_ENABLE_LIGHT_BLEND) {
// Directional light component is a function of the angle from the eye, between the fragment and the sun
vec3 fragToEyeDirWS = normalize(fragPositionWS - eyePositionWS);
@ -117,9 +120,6 @@ vec4 computeHazeColor(vec4 fragColor, vec3 fragPositionES, vec3 fragPositionWS,
vec4 glareColor = vec4(hazeParams.hazeGlareColor, 1.0);
// Use the haze colour for the glare colour, if blend is not enabled
vec4 blendedHazeColor;
if ((hazeParams.hazeMode & HAZE_MODE_IS_ENABLE_LIGHT_BLEND) == HAZE_MODE_IS_ENABLE_LIGHT_BLEND) {
blendedHazeColor = mix(hazeColor, glareColor, power);
} else {
blendedHazeColor = hazeColor;

View file

@ -64,7 +64,7 @@ void main(void) {
vec3 fragNormalWS = normalize(_normalWS);
TransformCamera cam = getTransformCamera();
vec3 fragToEyeWS = fragPositionWS - cam._viewInverse[3].xyz;
vec3 fragToEyeWS = cam._viewInverse[3].xyz - fragPositionWS;
vec3 fragToEyeDirWS = normalize(fragToEyeWS);
SurfaceData surfaceWS = initSurfaceData(roughness, fragNormalWS, fragToEyeDirWS);

View file

@ -66,7 +66,7 @@ void main(void) {
vec3 fragNormalWS = normalize(_normalWS);
TransformCamera cam = getTransformCamera();
vec3 fragToEyeWS = fragPositionWS - cam._viewInverse[3].xyz;
vec3 fragToEyeWS = cam._viewInverse[3].xyz - fragPositionWS;
vec3 fragToEyeDirWS = normalize(fragToEyeWS);
SurfaceData surfaceWS = initSurfaceData(roughness, fragNormalWS, fragToEyeDirWS);

View file

@ -66,7 +66,7 @@ void main(void) {
<$evalMaterialNormalLOD(_positionES, normalTex, _normalWS, _tangentWS, fragNormalWS)$>
TransformCamera cam = getTransformCamera();
vec3 fragToEyeWS = fragPositionWS - cam._viewInverse[3].xyz;
vec3 fragToEyeWS = cam._viewInverse[3].xyz - fragPositionWS;
vec3 fragToEyeDirWS = normalize(fragToEyeWS);
SurfaceData surfaceWS = initSurfaceData(roughness, fragNormalWS, fragToEyeDirWS);

View file

@ -75,7 +75,7 @@ void main(void) {
<$evalMaterialNormalLOD(_positionES, normalTex, _normalWS, _tangentWS, fragNormalWS)$>
TransformCamera cam = getTransformCamera();
vec3 fragToEyeWS = fragPositionWS - cam._viewInverse[3].xyz;
vec3 fragToEyeWS = cam._viewInverse[3].xyz - fragPositionWS;
vec3 fragToEyeDirWS = normalize(fragToEyeWS);
SurfaceData surfaceWS = initSurfaceData(roughness, fragNormalWS, fragToEyeDirWS);