So I'm using https://github.com/CyberAgent/android-gpuimage and I want to achieve this (apply the filter only to a zone of the image):
Uri imageUri = ...;
mGPUImage = new GPUImage(this);
mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
mGPUImage.setImage(imageUri);
sepiaFilter = new GPUImageSepiaFilter()
mGPUImage.setFilter(sepiaFilter);
is there a way to do something like:
TextureZone textureZone = new TextureZone(...);
sepiaFilter.setFilterOnlyOn(textureZone)
or do I need to go deeper and make a custom shader?
You have to write your custom filter with self-written fragment shader. In fragment shader, you should check for which fragment will be applied the filter.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.