Search Unity

Resolved Sprite loses shape when applying material

Discussion in 'General Graphics' started by RealMcCoyGames, Jul 11, 2021.

  1. RealMcCoyGames

    RealMcCoyGames

    Joined:
    Jul 23, 2018
    Posts:
    65
    On the right is the original sprite, on the left is the sprite with an emissive material applied.

    stars.png

    How can I keep the correct shape while still having it glow?

    Even if there was a way I could edit the shape on the left that would be great.

    TIA
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    When you use sprites in Unity, Unity will create a simple mesh to render the sprite on to. It's only roughly shaped, but normally you don't notice because the default sprite shader uses the sprite image map's alpha channel to make unnecessary parts in the mesh invisible. I think when you switched materials, you're now seeing just the raw mesh without sprite's transparency applied.

    I'm guessing that's what it is, anyway.

    If you are using the standard shader for emissiveness,though, all you need to do is set the rendering mode to "cut-out" and it will use your sprite's alpha channel for transparency that same as the sprite shader.
     
    Last edited: Jul 12, 2021
    RealMcCoyGames likes this.
  3. RealMcCoyGames

    RealMcCoyGames

    Joined:
    Jul 23, 2018
    Posts:
    65
    Thanks.

    Unfortunately I'm using URP/Lit on the shader. When I switch to standard it just goes purple.
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    I don't really know URP, really, but for the URP shader, try changing the "surface type" to transparent and then set the "blend mode" to alpha. Maybe that's the closest thing?
     
    RealMcCoyGames likes this.
  5. RealMcCoyGames

    RealMcCoyGames

    Joined:
    Jul 23, 2018
    Posts:
    65
    Unfortunately that doesn't work either. I've decided it doesn't really need to glow. It's only on screen for a split second and looks fine as it is tbh.

    Thank you for your help though!