Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

New GLator

Participant ,
Nov 30, 2017 Nov 30, 2017

Hi. I'm testing out the new GLator and the plugin it produces is 17mb, or 16.6mb with aggressive optimisation on. I'm guessing this might have something to do with it using glbinding. Is there a way to make the build smaller or should all openGL plugins be this size? Thanks.

TOPICS
SDK
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2017 Dec 03, 2017

Hi James,

glbinding is only one way to handle openGL textures and contexts in AE.

Personnally, I do it like this:

_I share one context for all my plugins instances, and each instance has its own textures.

_I store everything in GlobalData, everything related to the context on one side, all the textures in a std::vector

It's easier to handle (you store everything yourself so it's 'human readable').

To keep track of instances, I just use an int in GlobalData called instanceG, and one in sequenceData called intanceS. Everytime SequenceSetup is called, I increase instanceG, and copy its value in the newly created instanceS.

Everytime SequenceSetDown is called, I decrease instanceG, and instanceS is cleared.

This way, you'll get more sequenceData than the actual number of effects, cos' AE will create one for render and one for UI, but as long as you use your data only in the Render thread (which you should!), it won't really matter (UI instances only have 1 int to store int his case, not a real loss).

Then each instance can simply acces its textures in the std::vector with index [instanceS].

Note that it is only one way to do it, there are probably smarter ways, but this one does work.

And this way, my plugins weigh only a few hundred Ko.

Anyway, though the new GLator is much better than the old one, it's structure won't be supported by all graphic cards / computers. Some users reported bugs with my plugins, and I had to switch back to my good old personnal structure... and it fixed it.

Hope it helps!

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 09, 2019 Mar 09, 2019

Don't you have issues with using the same OpenGL context in multiple threads?

(Smart)Render function will be called from various threads and each will be rendering to a separate texture but within the same OpenGL context, right? No issues there?

The new GLator example creates new OpenGL context for every new thread. The problem I see in this example is that we get more and more render threads. I suppose some of them are released and new ones are created. When I try to playback a timeline consisting of 15 clips and plugin instance on each - number of threads grows! It quickly becomes 60, 80, and so on. There's no way to tell when the particular thread was released to release the associated resources.

In the example the per-thread data is released only on GlobalSetdown. This makes the plugin go into OutOfMemory territory...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 12, 2019 Mar 12, 2019

Hi,

the way I use OpenGL is like this:

-I create only one context for the plugin.

-each thread of each instance of the plugin activates this context at the beginning of the render thread and deactivates it at the end.

-when I'm done with the plugin (closing AE, most likely...), I destroy my context.

So, what it means is AE uses the same context whatever the thread or instance, it just draws on it, grab the pixels and let it hanging there for later use.

I didn't get any issue so far, so I would say it must work 🙂

Cheers,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2019 Mar 13, 2019

Important question - do you use your plugins also in Premiere Pro, or just AE?

Because looks like the issue I described happens in Premiere Pro only.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 13, 2019 Mar 13, 2019

Only AE, can't tell you about premiere... Sorry.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2019 Mar 13, 2019
LATEST

Alright. Thanks anyway!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines