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 is there a way to make this particle work everywhere?

Discussion in 'Universal Render Pipeline' started by dlorre, Aug 5, 2023.

  1. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Sorry if I am in the wrong forum, but I'm using URP and I think it might have something to do with my issue.

    I have a chessboard and I would like to use the particle system to highlight the squares. It works on dark squares but not on white squares, as you can see on the 2 screenshots here:

    upload_2023-8-5_16-23-28.png

    upload_2023-8-5_16-23-45.png

    Basically I'm a coder so I know very little about particles, materials and shaders. I understand that making the board darker makes the particle appear but that would affect the global lighting balance.

    Do you think I can solve this without replacing the particles with an ugly white square like everyone else?

    I have tried making the start color darker but that didn't help:

    upload_2023-8-5_16-28-32.png
     
  2. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    587
    This is generic advice for highlighting tiles, not Chess:

    It actually looks like the particle is there, just really brightly lit or blended.
    See how there's a radial gradient on this tile?

    upload_2023-8-5_21-59-53.png

    upload_2023-8-5_21-59-4.png

    It's a light colour on a light background, so you can't see it well.
    Your screenshot shows a gradient for the start colour:

    If you want the colour to change over lifetime, move the gradient colouring to the Color over Lifetime module. That way the colour will animate over the particle's life/duration.
    Visually/aesthetically speaking, you'd also perhaps want to consider using a square highlight particle/tile FX instead of a radial gradient, although perhaps your particles are placeholders because that looks like the default particle texture.

    upload_2023-8-5_22-15-28.png
     

    Attached Files:

    Last edited: Aug 6, 2023
    dlorre likes this.
  3. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Thanks for the input, my idea was that if one color is dark and the other bright then the particle should appear on both type of squares.

    I will look into square highlight, this comes from a particle package that I bought so I'm not sure about the texture but I will also look into that.
     
  4. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    I think it's an issue with my lighting because I made a new project and got this with default lighting:

    upload_2023-8-6_12-12-46.png
     
  5. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    587
    That's still light on light, and it looks like the particle is using additive blending (colour of particle is added over whatever is behind it). Try using alpha blending on the material and a colour that fits over both light and dark (like orange). The material of the board isn't so relevant as the particle.
     
    dlorre likes this.
  6. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Thanks, you are right it's litteraly a ShaderGraph material named Particle Additive. Raising the intensity from 2 to 8 helps a little but I guess I need another material because I can't keep adding more lights to the scene.

    upload_2023-8-6_12-58-24.png
     
  7. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    OK I think I've understood your pointers and got something like that:

    upload_2023-8-6_16-24-45.png

    It needs more refining but it looks like I'm on the right track. Thanks for your help!
     
    MirzaBeig likes this.
  8. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    587
    That image helps! Seeing the material of the particle, I mean.
    It seems simple enough you could just replace it with one of the included particle shaders.

    For example, the built-in shader has HDR emissive (intensity), texture sheet frame blending (Tex Sheet Blending) and soft particles (Geo Fade, I'm assuming), as well as camera fading (Fade Distance?). I'm not sure what "Fix Dark Edges" does, but for your purposes it's unlikely to be very useful based on the name.

    Just make sure you set the rendering mode to Fade or Transparent.
    There's no need for lighting a self-lit material, and they are very, very cheap.

    Built-in UNLIT (should work with URP):

    upload_2023-8-6_10-43-10.png

    URP Unlit OPAQUE (which is similar to your latest image):

    upload_2023-8-6_10-44-31.png

    TRANSPARENT:

    upload_2023-8-6_10-44-45.png

    This is alpha blending, and the colour of the particle isn't added to what's behind it, it's replacing it.

    Additive: gray particle over white background = white.
    Alpha: gray particle over white background = gray.

    TL;DR: Your particle/effect is simple.
    Just use a built-in particle shader, without additive blending, and with transparency.
     
    dlorre likes this.
  9. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Thanks, they work but they don't take a texture as surface input so the effect is square. It's good to know though. I think I can tweak this shadegraph so that the colors are right.

    As for dark edges it's caused by some PNGs if I understood well.


    ETA: this is what I get so far, there is indeed some kind of dark edge but it's the price to pay I guess


    upload_2023-8-7_12-20-7.png
     
    Last edited: Aug 7, 2023