Skip to content

Commit

Permalink
properly working
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Sep 17, 2022
1 parent 2d73375 commit 40500d9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FModel/Resources/outline.vert
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ uniform vec3 viewPos;

void main()
{
vec3 pos = mix(vPos, vMorphTarget, uMorphTime);
vec3 pos = vec3(vInstanceMatrix * vec4(mix(vPos, vMorphTarget, uMorphTime), 1.0));
vec3 nor = mat3(transpose(inverse(vInstanceMatrix))) * vNormal;

float scaleFactor = distance(pos, viewPos) * 0.0025;
vec3 scaleVertex = pos + vNormal * scaleFactor;
gl_Position = uProjection * uView * vInstanceMatrix * vec4(scaleVertex, 1.0);
vec3 scaleVertex = pos + nor * scaleFactor;
gl_Position = uProjection * uView * vec4(scaleVertex, 1.0);
}

0 comments on commit 40500d9

Please sign in to comment.