OpenGL support in OpenFX plugins in DaVinci Resove

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

Roman Kudinov

  • Posts: 5
  • Joined: Fri Jun 16, 2017 2:27 pm

OpenGL support in OpenFX plugins in DaVinci Resove

PostWed Jul 26, 2017 8:48 am

Hi,

I develop OpenFX plugin and can't make Resolve to render in OpenGL mode. Does anyone know if DaVinci Resolve supports rendering in OpenGL mode?


In kOfxActionDescribe I check the value of kOfxImageEffectPropOpenGLRenderSupported in the host property set. It is set to "true". Then I set this property to true to the effect's property set.


Code: Select all
    const char *oglSupport = NULL;
    gPropHost->propGetString(gHost->host, kOfxImageEffectPropOpenGLRenderSupported, 0, &oglSupport);
    std::cout << "oglSupport = " << oglSupport << std::endl;          //olgSupport == "true"
   
    // get the property handle for the plugin
    OfxPropertySetHandle effectProps;
    gEffectHost->getPropertySet(effect, &effectProps);
   
    //enable OpenGL processing
    gPropHost->propSetString(effectProps, kOfxImageEffectPropOpenGLRenderSupported, 0, "true");


I can fetch pointer to kOfxOpenGLRenderSuite suite successfully.

BUT! kOfxActionOpenGLContextAttached is never called and kOfxImageEffectPropOpenGLEnabled is not set during kOfxImageEffectActionRender action.


Code: Select all
        int oglEnabled = -1;
   status = gPropHost->propGetInt(inArgs, kOfxImageEffectPropOpenGLEnabled, 0, &oglEnabled);


oglEnabled == -1 always

What am I doing wrong?


Thanks
Offline

Justin Moore

  • Posts: 2
  • Joined: Wed Jan 10, 2018 7:01 pm

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostWed Jan 10, 2018 7:17 pm

Bumping this. In https://github.com/NatronGitHub/openfx- ... dertoy.cpp, the plugin specifies that it needs OpenGL support in kOfxImageEffectPropOpenGLRenderSupported, but Resolve calls render with kOfxImageEffectPropOpenGLEnabled set to false always.
Offline

Roman Kudinov

  • Posts: 5
  • Joined: Fri Jun 16, 2017 2:27 pm

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostWed Jan 10, 2018 10:23 pm

I tried to create my own OpenGL context and create textures from buffers provided by DaVinci, but it works unstable on Windows platform - freezes and hangs occur. Seems like it gets in conflict with the host.

So I finished with rendering in OpenCL and CUDA.
Offline

Justin Moore

  • Posts: 2
  • Joined: Wed Jan 10, 2018 7:01 pm

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostThu Jan 11, 2018 3:47 am

Unfortunately OpenCL/CUDA is not an option for Shadertoy, as the shaders are all written in GLSL.

I've managed to get it working without creating an external context, but it's super slow because I'm uploading/downloading images from the GPU every frame.

Here's the relevant code: https://github.com/DrChat/openfx-misc/c ... 0c18272ad5

Obviously it'd be nice if Resolve did all these copies for me. I think it's just a matter of implementing some unimplemented functionality.
Offline

jorlow

  • Posts: 3
  • Joined: Fri Nov 22, 2019 2:10 pm
  • Real Name: Jeremy Orlow

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostFri Nov 22, 2019 2:13 pm

I've been playing around with creating open FX plugins and was disappointed by this. It'd be great if Resolve could support OpenGL in OFX.

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], carsonjones, jtfgrading, KudzuRaccoon, Photo Frank and 197 guests