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

How to properly grow frame with GPU effect?

New Here ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

I'm attempting to write a basic effect plugin for PP that grows the frame by x pixels in each direction. I've got software rendering working via the After Effects API. However I'm struggling with the GPU accelerated path (using the xGPUFilterEntry entry point). To clarify, it works perfectly if I don't grow the frame, and just render straight into the output PPixHand passed to PrGPUFilter::Render.

 

The documentation here says "If the effect grows or shrinks the output area (e.g. rendering a drop shadow), it is allowable for the effect to allocate and return a different sized outFrame."

 

So I allocate a new frame with PrSDKGPUDeviceSuite::CreateGPUPPix, with exactly the same attributes as the input frame, only with a larger width and height. This "works", except obviously PP doesn't know where I want the frame positioned, so it appears to grow from the top left corner instead of from the center of the layer. I was thinking I just need to tell PP the rect for the frame. But there doesn't seem to be any function to set the rect (unlike PlugppixFuncs::ppixNew?). I've tried manually setting the "bounds" rect on the PPixHandle but it seems to not affect anything, and the comment next to it says "always 0,0 origin".

 

So in short, I can grow the layer, but how can I tell PP to offset the grown frame by x pixels in the x and y directions, instead of anchoring the top left corner to the position of the original (ungrown) layer?

TOPICS
SDK

Views

160

Translate

Translate

Report

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
New Here ,
Dec 19, 2023 Dec 19, 2023

Copy link to clipboard

Copied

LATEST

As a bump, I also have another related question about color management. I've noticed that when I allocate a new PPixHandle with PrSDKGPUDeviceSuite::CreateGPUPPix, it seems to break further color management (e.g. the "display color management" option does nothing when using a Rec.2100-PQ workspace, leading to colors looking wrong only when allocating a new texture), which implies to me that the PPixHandle has somehow got an invalid or null color space set on it.

 

I've tried allocating a PPixHandle with PrSDKPPixCreator2Suite::CreateColorManagedCustomPPix with one of the GPU formats, but it doesn't work and I didn't really expect it to.

 

The strange thing is, some Premiere video effects (e.g. drop shadow) do pretty much exactly what I want (grow the frame plus don't mess with color management). It's quite annoying that there are no docs or examples for this. As I said before, this works fine in AE and with software rendering via the AE API. Just not in Premiere with the GPU filter API.

Votes

Translate

Translate

Report

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