Apply Bloom only to specific Materials

@mvaligursky
Looking at your demo, and i dont find anything thats off.

i created an texture, an renderTarget, i have my layers specificed, i did set the priority on my second camera and enabled bloom on the second camera.

could you attach the log with logRenderActions enabled please, to see the overall set up of cameras and layers

1 Like

Sure,

all that seems ok … capture using Spector JS seems to confirm that as well.
And what do you do with the texture that’s part of the bloom render target? Are you displaying it somewhere?

Try debug displaying it this way
app.renderTexture(-0.6, 0.7, 0.6, 0.3, texture);

1 Like

i display it on a plane. but the bloom is not applied.

with app.renderTexture:

So I’m looking at the applyBloom - where do you set up bloom to apply to the texture? Or that elsewhere? Something along this from my example

textureCamera.addComponent("script");
            textureCamera.script.create("hueSaturation", {
                attributes: {
                    hue: 0.0,
                    saturation: 0
                }
            });

is that applied in the editor? Can you try and apply that using script … perhaps the order is the problem.

1 Like

Yea it is applied in the editor, will change that.

@mvaligursky
adding / activating the post processing after the setup works.

resizing has a strange effect on the whole output for some reason.

without post processing this dosent happen:

ok that makes it clearer where the problem is … I’ll try to fix this as well.
I’d appreciate if you could create a repro of this on github to track this: thub.com/playcanvas/engine/issues
thanks!

1 Like

Created the issue:

1 Like

any update on this? :slight_smile:

not yet, sorry.

Please, Please, Please, Playcanvas Team, i really need something like this in playcanvas : :cry:

Glow effect on material, and glow posteffect on all the scene : this is not the same thing ^^

https://youtu.be/KYGS3cL-elE

Thanks for your help ! have a nice day,

Antoine

2 posts were split to a new topic: How to apply bloom only to line rendering?

I would probably do this:

  1. change the current camera that render the world to be at priority 1 (so it renders second)
  2. add a child camera to current camera, with the same perspective settings. Making it a child should make it have the same transformation. Call it BloomCamera, set its priority to 0 ( so it renders first), add a layer to it with objects you want bloomed. And set it up to render to a render target texture. And clear color to black on this camera.
  3. Attach bloom postprocessing to this BloomCamera - this should bloom only the object that you rendered to it.
  4. To your main camera set up some callback, for example on before UI layer gets rendered. This should additively blend the bloomed renderer target texture on top of already rendered framebuffer of the main camera.

It doesn’t work

Try debug displaying it this way
app.renderTexture(-0.6, 0.7, 0.6, 0.3, texture);

It says that renderTexture is not a function.

Hi @Marks,

For that specific line you need to update it to:

app.drawTexture(-0.6, 0.7, 0.6, 0.3, texture);
2 Likes

Hi, Everyone, do we have a solution for this yet?

If so, any sample project? I would love to know.

Thanks in advance,

Hi @lenvanthis, not sure if there is a sample project. @mvaligursky given the latest updates to the PC engine, what’s the proposed way of doing this now?

I don’t believe there’s anything new since I responded to this last time on the forums, there are few topics discussing options around here.

1 Like