Re: [FCP FxPlug 1.2] Using FxTexture by modifying his pointer
Re: [FCP FxPlug 1.2] Using FxTexture by modifying his pointer
- Subject: Re: [FCP FxPlug 1.2] Using FxTexture by modifying his pointer
- From: Paul Schneider <email@hidden>
- Date: Fri, 29 Jul 2011 10:37:43 -0500
Hi Max,
An oddity of the FxPlug API is that when you are running on the GPU (using textures), the drawing destination is the current GL context. The output FxTexture doesn't represent the destination buffer; it's mostly used to tell you the drawing coordinates.
To get your modified pixels to appear in the destination, you'd want to draw a rectangle textured with your modified texture into the current GL context. The example projects included with the SDK demonstrate this.
Also, it looks like you're modifying the image on the CPU, not the GPU. The code you show here downloads the pixels from the GPU, changes them in main memory using the CPU, then uploads the result back to the GPU. This isn't always the most efficient way to go. You might want to consider using FxBitmaps instead. If you set "canRenderHardware" to NO in your -frameSetup method, you'll receive FxBitmaps instead of FxTextures.
- Paul
On Jul 29, 2011, at 9:08 AM, Gohin Julien (Neo-Soft) wrote:
> Hello,
>
> I'm new on developping FCP Plug-Ins (my configuration FCP 7.0, SDK 1.2).
>
> I'm trying to use FxTexture input pointer data, modify it (change somes RGBA pixels) and restore the new pointer to the FxTexture output but it in FCP, a black picture appears in the canvas.
>
> In the RenderOutput :
>
>
> FxTexture *texture = (FxTexture*)inImage;
>
> GLubyte *inPtr = (GLubyte*)[texture createData:GL_RGBA withType:GL_UNSIGNED_BYTE];
>
> //get the contains of "inPtr", put it into my engine which will modify it
>
>
> FxTexture *texture = (FxTexture*)outImage;
>
> GLubyte *outPtr = (GLubyte*)[texture createData:GL_RGBA withType:GL_UNSIGNED_BYTE];
>
>
> //copy inPtr into outPtr
>
> All seems good at this step, outPtr is well set with the new value.
>
> And finally, i tried to set the new modified pointer in the output Texture but it don't work in the canvas ?
>
>
> [texture setData:(GLubyte *)outPtr];
>
> Maybe i miss something ? Any ideas ? Thank you for your help.
>
> Max Canet,
> Technicolor, France
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Pro-apps-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden