Got a crash when using GPUImageFilter

前端 未结 1 881
花落未央
花落未央 2021-01-17 04:29

I started from Brad Larson\'s Tutorial on Github.Here when i added these code into my project

- (void)viewDidLoad
{
[super viewDidLoad];

GPUImageVideoCamera         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 04:58

    The above code tries to create a filter from a custom fragment shader file (in this case, CustomShader.fsh). For this to work, you need to have a file by that name in your project, and need to make sure that it is in the copying resources build phase for your project, not the compiling sources build phase. It also must be a valid fragment shader of the style expected by the project. The MultiViewFilterExample has one of these.

    I should note that this is only necessary if you want to create your own custom fragment shader for a filter. As an alternative, you can use one of the 100+ other filters that come with the framework, and avoid this process.

    0 讨论(0)
提交回复
热议问题