Fix normal calculation in MorphPhongMaterial

Change-Id: Iad160f2d454633b558bee91b1e01c287d4202451
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
This commit is contained in:
Joni Poikelin 2018-10-05 11:29:15 +03:00
parent c82d0c81aa
commit d8789d8fd1
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ void main()
morphNormal = normalize(vertexNormal + vertexNormalTarget * abs(interpolator));
}
worldNormal = normalize( modelNormalMatrix * morphPos );
worldNormal = normalize( modelNormalMatrix * morphNormal );
worldPosition = vec3( modelMatrix * vec4( morphPos, 1.0 ) );
gl_Position = modelViewProjection * vec4( morphPos, 1.0 );

View File

@ -27,7 +27,7 @@ void main()
morphNormal = normalize(vertexNormal + vertexNormalTarget * abs(interpolator));
}
worldNormal = normalize( modelNormalMatrix * morphPos );
worldNormal = normalize( modelNormalMatrix * morphNormal );
worldPosition = vec3( modelMatrix * vec4( morphPos, 1.0 ) );
gl_Position = modelViewProjection * vec4( morphPos, 1.0 );