Skip to content

Commit

Permalink
fix a bug in bulge distortion fragment shader which causes the distor…
Browse files Browse the repository at this point in the history
…tion area to be misplaced when the distortion center y is not 0.5
  • Loading branch information
YuAo committed Feb 5, 2015
1 parent 011f4af commit 4879be2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/Source/GPUImageBulgeDistortionFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

void main()
{
highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio));
highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, ((textureCoordinate.y - center.y) * aspectRatio) + center.y);
highp float dist = distance(center, textureCoordinateToUse);
textureCoordinateToUse = textureCoordinate;

Expand Down Expand Up @@ -45,7 +45,7 @@ void main()

void main()
{
vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio));
vec2 textureCoordinateToUse = vec2(textureCoordinate.x, ((textureCoordinate.y - center.y) * aspectRatio) + center.y);
float dist = distance(center, textureCoordinateToUse);
textureCoordinateToUse = textureCoordinate;

Expand Down

0 comments on commit 4879be2

Please sign in to comment.