- Home /
How to use the new Post processing to make a SPECIFIC sprite in the scene bloom (from Unity 2019.2) ?
From the version 2019.2 there is a new Script called "Volume" for Post Processing, I'd like to use it to add glow effects on SOME objects in my scene. But the gloom is global, it either affects all the lighted sprites or none of them. I want to make only some of them glow, maybe based on Layers ?! I tried local Volumes, but I don't see any affects and it includes 3D colliders.
Answer by Namey5 · Apr 03, 2020 at 11:29 PM
Volumes aren't used to affect specific objects, more so to define areas that will use a different post-processing preset when the camera passes through that region. There is no way to apply post-processing to a single object - the stack is only supplied the final image as an input and some data about the rendering. If you wanted to apply an effect to a single sprite you would need to use a custom shader that applies the effect directly to the sprite's texture.
Thanks for the clarification, I hope Unity will add such feature in the future, because it seems to me as a must. Or I think, I'll have to add the other version of Post Processing from the Package $$anonymous$$anager and add layers to the specific objects I'd like to glow.
The problem is more that it just isn't possible with how post-processing is done. You would need fairly major changes to the renderer just to include it and even then it would have to be done purely through the stencil buffer. Here's a tutorial that does what you want through command buffers, but it may or may not work in your case;
https://lindenreid.wordpress.com/2018/09/13/using-command-buffers-in-unity-selective-bloom/
Answer by nubbyninja · Dec 06, 2021 at 09:20 AM
Necro, but oh well. If you want to use different post processing on separate objects then first, assign those objects a different layer from your primary post processed objects.... for instance if the only things you want different are "boat" and "car" you could make a layer for "vehicles" (for example) then assign those objects to that layer Create a new overlay camera, exclude all layers except for "vehicles". On your main/primary camera, add the overlay camera (it's obvious when you find it) Now, create a new post processing asset, add the asset to a game object with the "Volume" component, then set that in your overlay camera's rendering.
Also keep in mind, the "local" post processing which utilizes colliders, you may want to assign those post processing objects to a new layer "PP_House" (for example) and then in your Physics matrix under the Physics section of Project Settings make sure it can't interact with your player with physics. That way you don't have a giant invisible wall for no reason.
Answer by Uialeth · Apr 04, 2020 at 03:18 PM
You should look into this https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html It's used to set material values per renderer, while allowing said materials to share the same shader instance
Your answer
Follow this Question
Related Questions
Hard edges on bloom effects (pps 2.0) in VR project 2 Answers
How to apply light on post processing volume 0 Answers
Bloom flickering when moving? 0 Answers
Why Inspector and Main camera are such different? No shadows as well :( 0 Answers
Point light "resolution" worse and worse the further it is from spawn point 0 Answers