Closed oguzgu closed 6 years ago
Hi,
I added a custom kawase blur filter to my project.
` precision highp float;
varying lowp vec2 textureCoordinate; uniform sampler2D inputImageTexture;
vec4 KawaseBlur(vec2 pixelSize, int iteration, vec2 halfSize, vec2 uv) { vec2 dUV = (pixelSize * float(iteration)) + halfSize;
vec2 texcoord; texcoord.x = uv.x - dUV.x; texcoord.y = uv.y + dUV.y; vec4 color = texture2D(inputImageTexture, texcoord); texcoord.x = uv.x + dUV.x; texcoord.y = uv.y + dUV.y; color += texture2D(inputImageTexture, texcoord); texcoord.x = uv.x - dUV.x; texcoord.y = uv.y - dUV.y; color += texture2D(inputImageTexture, texcoord); texcoord.x = uv.x + dUV.x; texcoord.y = uv.y - dUV.y; color += texture2D(inputImageTexture, texcoord); color.rgb *= 0.25; return color;
}
void main() {
int Iterations = 1; // fixed resolution // test for iphone 6 vec2 iResolution = vec2(750.0, 1334.0); vec2 uv = textureCoordinate / iResolution; uv.y = -uv.y; vec2 pixelSize = vec2(1.0) / iResolution; vec2 halfSize = pixelSize / vec2(2.0); vec4 color = vec4(0); for(int i = 1; i <= Iterations; i++) { color = KawaseBlur(pixelSize, i, halfSize, uv); } gl_FragColor = color;
} `
But it is not working properly, it shows only white screen when camera capture started, then only shows a few colors whem moving camera.
How can i solve this problem?
Hi,
I added a custom kawase blur filter to my project.
` precision highp float;
varying lowp vec2 textureCoordinate; uniform sampler2D inputImageTexture;
vec4 KawaseBlur(vec2 pixelSize, int iteration, vec2 halfSize, vec2 uv) { vec2 dUV = (pixelSize * float(iteration)) + halfSize;
}
void main() {
} `
But it is not working properly, it shows only white screen when camera capture started, then only shows a few colors whem moving camera.
How can i solve this problem?