engine icon indicating copy to clipboard operation
engine copied to clipboard

Custom Post Effects

Open Maksims opened this issue 4 months ago • 3 comments

Would be great to have a simple and nice API for creating custom post effects with the new CameraFrame system.

Currently, docs: https://developer.playcanvas.com/user-manual/graphics/posteffects/ As well as the engine: https://github.com/playcanvas/engine/tree/main/scripts/posteffects Contains old post-effects, while they all are deprecated. And does not work out of the box when used with recent engine (requires to use class instead of prototype inheritance). Also, the old system does not mix with the new system, if you try to use both systems together, it simply renders black screen.

It would be great to have a proper new system, that allows an easy way to define custom post-effects, and add them into the queue in CameraFrame.

New system while it has higher quality effects, it really lacking in examples and flexibility for custom effects. It is not even possible to override its implementation chunks: https://github.com/playcanvas/engine/issues/7921

Maksims avatar Aug 25 '25 08:08 Maksims

I keep thinking about how to make something like this possible, and it certainly is not easy, as easy and performant are often two ends of the spectrum.

I have one example showing how to add custom render passes. Note that this does not use CamerFrame, and so it's a bit limited: https://playcanvas.vercel.app/#/graphics/render-pass

On the other hand, the CameraFrame is set up in a way the user can extend the class, and add custom rendering passes. It's not easy, as users rendering passes need to often integrate with other passes (be done in the right order for example), so this is something more advanced users would do.

But it's definitely on my list to improve, make easier to add passes in perhaps less than optimal way. And also add more built-in post effects that are simply available.

mvaligursky avatar Aug 29 '25 10:08 mvaligursky

On the other hand, the CameraFrame is set up in a way the user can extend the class, and add custom rendering passes. It's not easy, as users rendering passes need to often integrate with other passes (be done in the right order for example), so this is something more advanced users would do.

If there would be more documentation and/or example of such, that would be amazing.

Maksims avatar Aug 29 '25 13:08 Maksims

here's one example which documents a simple compose shader modification, that does not require additional render passes: https://github.com/playcanvas/engine/pull/7989

mvaligursky avatar Sep 19 '25 15:09 mvaligursky