From c80666c3754ea335986b1456677d8b87fc7d6473 Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Fri, 13 Sep 2013 17:18:16 -0500 Subject: [PATCH] Fixed two precision issues with the levels and lookup filters. --- framework/Source/GPUImageLevelsFilter.m | 12 ++++++------ framework/Source/GPUImageLookupFilter.m | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/framework/Source/GPUImageLevelsFilter.m b/framework/Source/GPUImageLevelsFilter.m index 4844340ba..158815fd5 100644 --- a/framework/Source/GPUImageLevelsFilter.m +++ b/framework/Source/GPUImageLevelsFilter.m @@ -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); } diff --git a/framework/Source/GPUImageLookupFilter.m b/framework/Source/GPUImageLookupFilter.m index d9bba913f..23f45b9d6 100644 --- a/framework/Source/GPUImageLookupFilter.m +++ b/framework/Source/GPUImageLookupFilter.m @@ -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);