Search Unity

Alternative to Decals?

Discussion in 'General Graphics' started by Terminus001, May 17, 2021.

  1. Terminus001

    Terminus001

    Joined:
    Nov 1, 2015
    Posts:
    121
    Hi everyone,

    I am planning to make a blood system for my FPS project (built-in pipeline using deferred rendering) and I am facing some doubts/difficulties. In one of my past games (URP using forward rendering), I used a decal system, but it was clearly too expensive in terms of performance: There was no batching occurring and the draw calls were increasing linearly (I think) with the number of decals in the camera view. So if there were too many decals in the camera frustum, framerate would drop significantly. I had to use a pooling system for limiting this performance issue.

    upload_2021-5-17_11-15-3.png
    [decals stacking up in my old game's scene resulting in fps drops]

    I really didn't like using a pooling system because it meant that the blood on my character had to be removed at some point, even if the dead character was still in the scene. This kills immersion and takes away from realism which is something that I would like to avoid.

    In order to counter this problem I've been researching alternative systems and I found a very interesting alternative:
    Video:

    Github: https://github.com/asaia/BleedingEdgeEffects_GDC_2020
    This system allows you to draw directly on the UVs of any mesh/skinned-mesh. I tested this and apparently it increases draw call count momentarily (while you are drawing on the mesh) but as soon as you are done drawing, you have your original draw calls back, with an updated texture (with blood or whatever you want) on your mesh. This is amazing, but it is made for URP.. and one shader is made with shadergraph, so I cannot import it in my built-in project. I would have to convert the whole shader and I don't think I am capable of doing this.

    Now I am looking for more alternatives.
    1. Does anyone know of a really performant decal system (supporting more that 300 decals on a scene without major performance hits)?
    2. Does something like this even exist or am I living in a dream?
    3. Does anyone know an alternative system similar to the one mentioned above (GDC video)?
    4. Does anyone know any other alternative system which I could use and is very performant?

    Thanks in advance!
     
  2. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,742
    Stop. First of all, you cant compare Builtin to URP. 2 total different monsters here (URP is an SRP). Decals are the only way to do what you want to do.

    Built-in pipeline using deferred rendering is (IMHO), the best visually/gfx your going to get, without going to a SRP build (URP/HDRP). Which presents its own set of probs/compatability...
     
  3. Terminus001

    Terminus001

    Joined:
    Nov 1, 2015
    Posts:
    121
    Hi, thanks for the reply.

    My aim was not really to compare the two different pipelines. I used the example of URP because my previous game was built on that and it used decals. After a couple of bad experiences I will not switch to any SRP for my future projects until they are mature enough, sticking with built-in is the way forward for me now.

    So, you say that there is no other way than decals..? However, those guys at GDC did manage to pull off something really great and more performant than decals. It sounds a bit strange that they were the only ones to pull it off. At the end of the day it's a "draw on UVs" system. I don't understand why a system like that is so rare to find. Sure, I guess many devs don't show around their clever solutions to problems, but still.. someone always does at one point in time and shares his/her experience online.

    Thanks again