RenderTarget with PostEffects Not Working


I have a camera with the hue-saturation post effect script applied from this tutorial (Post Effects | Learn PlayCanvas) .

I also have a custom layer called “SeparateObjects” applied to this same camera. When creating a render texture of the camera without the the post effect enabled it works fine. But once the post effect is applied it only renders a black screen.

Could anyone here point me in the right direction for making post effects work through a render target?

I realized that there are a few other people who came across this problem over a year ago (Can not get rendertarget when camera's posteffect is on
). One post I read said that I should use the camera’s renderTarget variable instead of a layer’s renderTarget. I have tried this but there was no change unless Im doing it incorrectly. Is there an example of how to do this?

I’m happy to setup an example if needed.

Thank you for your time.

I apologize! It works now!

Please forgive my simple mistake of
this.cameraEntity.renderTarget = renderTargetVariable;
should have been = renderTargetVariable; .

However I noticed that the texture is still flipped on the X and Y axis even though I set the flipX and flipY to true when initializing the RenderTarget object. Even when its set to false theres no change. Does anyone know why?

I was able to fix this by just rotating and flipping the object that I’m applying the RenderTexture object to but this may cause some issues in the future ?

Thank you again for your time

Glad you got this working.,
Here’s an example that likely works too:

(this is not an editor project, but uses the engine directly)