Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Bloom on particular sprites

Discussion in 'Universal Render Pipeline' started by MoonJellyGames, Jul 4, 2023.

  1. MoonJellyGames

    MoonJellyGames

    Joined:
    Oct 2, 2014
    Posts:
    324
    Hey all,

    First off, apologies, as I know this has been discussed before, but after reading and watching everything I could find on the subject, I haven't had any success. Sometimes it just helps to be able to talk it out, you know?

    I've managed to get bloom lighting working in my last project, but that was easy because it was intended to be applied to everything in the scene. Similarly, I have a minimap camera in my current project which also has a bloom effect that works just fine.

    The current goal is just to make certain objects glow, ideally, with a level of intensity that I can adjust on a per-object or at the very least, per type of object basis.

    A lot of this stuff feels over my head, to be honest. I don't exactly know what some of these things are that I've been working with while following tutorials/directions from documentation or forum users elsewhere. In my Project Settings, I have the Scriptable Render Pipeline Settings set to a UniversalRenderPipelineAsset, which I assume I made last year while getting the minimap glow working. That asset has a "render list" property, which is set to something called URP 2D_Renderer. I don't really understand what the relationship is between these two things.

    I've tried adding a Post Processing Layer to my main camera, a Post Processing Volume (with Bloom override) to another object in the scene, and that hasn't really gotten me anywhere. One tutorial showed that the camera with the PP layer, the object with the PP volume, and the objects that I want to be affected by the bloom all need to be on the same layer. I'm hoping this isn't the case because my layers have been chosen based on the physics relationships they have. Making exceptions for things that glow would really overcomplicate things.

    The last post in this thread (https://forum.unity.com/threads/adding-bloom-to-only-specific-objects.430511/) seemed to have a promising suggestion as it seems you could control the bloom effect on particular objects (or sets of them, at least) via their material. They say to "use one camera with bloom post processing enabled". What does that mean though? Add a Post-processing Volume component with a Bloom override? Do the same, but with a Volume component? It seems like I may have the wrong material on my target sprites as well. They're currently Default, but I've tried Sprites-Lit, as well as others that either do nothing or cause distortions (probably because they're intended for 3D models, I assume).

    I'm sure this isn't enough information to get answers, so please let me know what you need to know to help. This is driving me crazy.

    And, of course, thank you for your time.
     
  2. revolute

    revolute

    Joined:
    Jul 28, 2014
    Posts:
    50
    Perhaps you should try and look up emissive urp 2d shaders.
    The basic idea is that you set certain materials with emissive shader so that only those glow.
    Set bloom threshold slightly high so that normal objects ( presumably using Sprite-Lit-Default shader ) doesn't get glowing effect.
     
  3. MoonJellyGames

    MoonJellyGames

    Joined:
    Oct 2, 2014
    Posts:
    324
    That sounds like what I'm going for.

    I was just typing up my response when I solved part of my current issue. For awhile, I couldn't get anything to show bloom on my main camera at all. I realized that the Volume Mask needs to include the layer that the camera is on as well. My cam was on Default, which isn't allowed as a Volume Mask option, so I made a new layer. Everything glows now.

    All of my sprites had Sprites-Default material, and yet they glow. I didn't expect this. I can turn the threshold up, as suggested, but now I'm trying to find a material that I can assign to the ones I do want lit. The Sprites-Lit_Default material doesn't seem to have any way to adjust how bright it lights up. I assumed there would be something like this, but I'm not seeing it.

    I know that you can make shaders from scratch, but that's probably beyond me. Hopefully that's not the route I need to go.

    In any case, thank you for the response.