Search Unity

Salvaging HDRP: PLEASE HELP

Discussion in 'Shaders' started by aeldred28, Feb 15, 2019.

  1. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    My development team and I find ourselves at a serious graphical roadblock. Transparent and Faded materials have not been able to support shadow reception on deferred forever, and nobody in the course of a decade has been able to solve this in a way that is remotely servicable. That is, until HDRP and the Scriptable Render Pipeline magically solved it. We are at a point in our game's development where upgrading to HDRP completely is simply not possible with all our custom shaders, and we dont have time to wait years for it to be adaptable enough for us.

    We don't care for anything in HDRP right now except for its ability to fix transparent materials. We absolutely require transparent shadow materials if we are going to make a good looking game the way we want, so does anybody out there know of a way to strip the HDRP down to its bare bones, just so we can have a nice transparent material that receives shadows? We are desparate for a solution and are looking for any information on this.
     
  2. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    What we want to be able to do without the rest of HDRP:

    Would it be possible to get the LIT shader out of HDRP functionally, without having to destroy all our other custom shaders like we would if we were to upgrade completely?
     

    Attached Files:

    Last edited: Feb 15, 2019
  3. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    The LIT shader runs on a completely different pipeline that has different buffers setup to use and data configured differently in those buffers, hence the term "Render Pipeline" in HDRP. You wouldn't be able to just simply strip the other stuff out of HDRP and somehow get the benefits from this shader. Your only real option is to create a custom DeferredShading.cginc and DeferredLighting.cginc to set as overrides in your graphics settings and modify this classic deferred pipeline to handle transparent objects and shadows on them, and this is no simple task.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Not possible.

    The HDRP is a completely different way of handling rendering compared to the build in deferred or forward paths, there's no way to extract just the "shadow casting on transparencies" from the rest. It works because they're using a scriptable render pipeline that adds that functionality. And you cannot use an SRP and the built in pipelines together, it's one or the other.

    Technically you could strip the HDRP down to the bare bones, or start with the simpler LWRP which kind of already is a bare bones version (though is forward only, and doesn't currently support shadows on transparency, but did earlier in development). But either way going with either of these will require rewriting all of your shaders to support that SRP, or writing your own complete SRP from scratch that mimics the built in deferred renderer.


    Also, it should be noted, when using the built in paths, transparent objects aren't rendered using the deferred rendering path. Transparent objects use the same forward render path regardless of which path you're using, because deferred only handles opaques.
     
    Last edited: Feb 15, 2019
  5. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    We suspected that messing with the CGinc files would be the answer, but unfortunately nobody on our team is savy with advanced shader code, and we have not encountered anybody for hire whose willing to undertake such a task. Nobody in the last 10 years from what I've seen has solved this issue, so what? Does that mean this is a dead end limitation of Unity?
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    No. The HDRP doesn't use any of the existing shader code from the built in rendering paths. There's nothing to change in the cginc files because HDRP doesn't even use cginc files.

    The reason shadows doesn't work on transparent objects is because the built in rendering paths don't pass the shadow maps to transparent objects, and the way the main directional light does shadows explicitly does not allow for transparency. There's no way to change this behavior, and while it's possible to copy the shadow maps from script, there's no way to pass that to the built in shaders in a way that matches the shadow map to the light, apart from the main directional light's shadow map.



    It works in the HDRP because SRPs have complete control of the full rendering systems and does pass shadow maps to transparent objects. It's also generating those shadow maps in a completely different way than the built in rendering paths that's incompatible.
     
    Last edited: Feb 15, 2019
  7. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    That's unfortunate, it seems that my team and I will have to work around this limitation rather than solve it then. Upgrading to HDRP fully is simply impossible for our game at this point in development with all the custom graphics and tweaks we use, everything would be lost.