Skip to content

Commit

Permalink
Fixed two precision issues with the levels and lookup filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLarson committed Sep 13, 2013
1 parent 0da6c5c commit c80666c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions framework/Source/GPUImageLevelsFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
varying highp vec2 textureCoordinate;

uniform sampler2D inputImageTexture;
uniform lowp vec3 levelMinimum;
uniform lowp vec3 levelMiddle;
uniform lowp vec3 levelMaximum;
uniform lowp vec3 minOutput;
uniform lowp vec3 maxOutput;
uniform mediump vec3 levelMinimum;
uniform mediump vec3 levelMiddle;
uniform mediump vec3 levelMaximum;
uniform mediump vec3 minOutput;
uniform mediump vec3 maxOutput;

void main()
{
lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);

gl_FragColor = vec4(LevelsControl(textureColor.rgb, levelMinimum, levelMiddle, levelMaximum, minOutput, maxOutput), textureColor.a);
}
Expand Down
8 changes: 4 additions & 4 deletions framework/Source/GPUImageLookupFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

void main()
{
lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);

mediump float blueColor = textureColor.b * 63.0;
highp float blueColor = textureColor.b * 63.0;

mediump vec2 quad1;
highp vec2 quad1;
quad1.y = floor(floor(blueColor) / 8.0);
quad1.x = floor(blueColor) - (quad1.y * 8.0);

mediump vec2 quad2;
highp vec2 quad2;
quad2.y = floor(ceil(blueColor) / 8.0);
quad2.x = ceil(blueColor) - (quad2.y * 8.0);

Expand Down

0 comments on commit c80666c

Please sign in to comment.