Open kissfro opened 11 years ago
Yeah, I think there's something odd about the way that it handles the second (lookup) texture. It tends to get corrupted after using a blend somewhere else, too, so I think there's something wrong with how it handles state somewhere.
This sounds familiar to a bug I fixed quite a while ago. Take a look at https://github.com/BradLarson/GPUImage/pull/766 to see if it gives you any clues.
Thanks for the responses guys. I actually did take a lot at that a couple of days ago, but I'm still getting the issue with the look up filters. I have Amorteka, Elegance, and Miss Etikate in a chain with some other filters, and every time another filter changes, if I don't reinstantiate the look up filter, then it won't get applied.
Solved this by calling [lookUpFilter prepareForImageCapture]; right before [self.filterImage processImage]; So had to figure out which and if any lookUpFilters were in my chain, then had to cycle through them and call prepareForImageCapture before applying the filter and it works (maybe this is what you were trying to say Cam). Anyways, thanks guys.
I'm going to reopen this because the work around has become obsolete with "prepareForImageCapture" being eliminated with the new frame buffer architecture. The problem still exists with the new memory system i.e. once a look-up filter is applied, it's unable to have other filters chained on top of it.
@kissfro: Calling processImageWithCompletionHandler:(void (^)(void))completion; and processing the lookupImageFilterGroup manually in the completionHandler did the trick for me.
My setup: StillImageSource->Filter->Filter->LookupFilterGroup(LUTFilter)->Output
For clarification here the code snippet.
__weak typeof(self) weakSelf = self;
[self.stillImageSource processImageWithCompletionHandler:^{
[weakSelf.lutFilter processImage];
}];
Hope this helps.
@BradLarson : Maybe we could note in the lookup filter tutorial?
Cheers Ben
I notice that when you apply Amatorka, Soft Elegance, or Miss Etikate to an GPUImagePicture, if you remove the filter, and try to readd it again later, it won't apply (nothing happens).