Search Unity

Replacement for projector in URP?

Discussion in 'Universal Render Pipeline' started by mitchscobee, Nov 9, 2020.

  1. mitchscobee

    mitchscobee

    Joined:
    Feb 22, 2019
    Posts:
    2
    I'm creating a game to play TTRPGs with friends online in VR, and a big part of those types of systems is having a grid overlay on the board. Like this:

    This was easy enough to do using a projector previously. But when I switched to URP, projectors no longer work.
    Is there a way to accomplish the same effect of a grid overlay in URP?

    Thanks
     
  2. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I recently made a water shader for URP. One feature was caustic, so I implemented a custom render pass. It's projecting a tile able texture onto the complete map. Sure, you could limit it to a specific world height and range. So you would need a custom URP forward render feature. Check out this tutorial:

    https://learn.unity.com/tutorial/custom-render-passes-with-urp

    If you want a decal system, there are some options on Asset Store for URP. Sadly, no built-in support for URP at the moment. :(
     
  3. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
  4. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    116
  5. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    From 2021.2 URP supports the SRP Decal Projector. You can download the latest prerelease from the Hub to give it a try :)
     
    M_R_M and Lars-Steenhoff like this.
  6. Koderoon

    Koderoon

    Joined:
    Jul 9, 2015
    Posts:
    1
    Need Layers, because in the opposite case, they are drawn wherever needed and not needed!
     
    NeatWolf, reinfeldx and Deleted User like this.
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I couldn't find any exclusionary properties on materials or anything. HDRP allows a material to not be included with decals, and this is often enough for most cases, but I couldn't work out even how to do that.

    Therefore I don't see the use of the current decal system except for tiny bullet marks.

    Hopefully someone will be along to correct us.
     
    NeatWolf and Deleted User like this.
  8. frostyone

    frostyone

    Joined:
    Aug 2, 2018
    Posts:
    8
    this is so stupid , I have no idea why there's no native support for real time projection in URP
     
    Renatusdev likes this.
  9. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Layer support is planned for the URP decal projector. I'll make sure to update this thread when I know more!
     
    M_R_M, Deleted User, NotaNaN and 2 others like this.
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Cheers it's a bit (totally) limited at the moment in a real game with characters picking up all sorts. To address it, a render order feature was needed which brought other problems with it :)
     
    NotaNaN likes this.
  11. fariculteur

    fariculteur

    Joined:
    Apr 22, 2021
    Posts:
    1
    Some news information on the layers filters for Decal Projector ? :)
     
    reinfeldx likes this.
  12. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Nope sadly no. Only thing I can say for certain is that it won't be supported in 2021.2
     
  13. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    @mitchscobee With layers not being supported in the first release of the decal projector, maybe this workaround could be an option for you;
    You could isolate decals to the floor by having the floor be rendered by an overlay camera that doesn't clear depth. This overlay camera would use a renderer with the decal renderer feature added, and the base camera would use a renderer without it. This does mean that you can't put decals on anything other than the floor, so I don't know if that is a viable solution for you.
     

    Attached Files:

  14. markovicho

    markovicho

    Joined:
    Nov 2, 2016
    Posts:
    5
    @Jonas-Mortensen

    i am using Unity 2021.2.b16 and paying around with the new decal projector for URP. On Android it works nicely. Unfortunately it's not working on WebGL (2.0). Is this a known issue or not supported at al ?

    upload_2021-10-19_13-14-19.png
     
  15. maewionn

    maewionn

    Joined:
    Jan 18, 2016
    Posts:
    38

    Joho! A bunch of months later, where are we on that end?
     
  16. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Decal layers landed in URP and is available in the latest 2022.2 alpha
     
    zhuhaiyia1 and reinfeldx like this.
  17. YoNeyers

    YoNeyers

    Joined:
    Feb 10, 2017
    Posts:
    32
    but still it's bugge on android :#
     
  18. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Hi, have you tried switching to Vulkan for android builds? AFAIK URP Rendering Layers (Decal Layers) don't support OpenGL backends.
     
  19. YoNeyers

    YoNeyers

    Joined:
    Feb 10, 2017
    Posts:
    32
    i did , in Vulkan the decal does not show at all , i'm trying to make a fake shadow under the car ,
    do you know any way around?