Home Unreal Engine

Expanding DBuffer Decals

2

Replies

  • frmdbl
    Options
    Offline / Send Message
    frmdbl polycounter
    @andrad

    Both are 'Dbuffer Translucent CNR Metallic, the difference is the underlying material.

    On the left the response is the default CNR, on the right CNRM.


  • andrad
    Options
    Offline / Send Message
    andrad polycounter lvl 5
    @frmdbl I have to wait for the engine to finish building, so i can only test in about two hours. But I have a suspicion that, if correct, can explain everything.

    In the screenshots you did above, did you use the view mode "Unlit" or did you use the buffer visualization view mode "Base Color"? I suspect it is the former, in which case you should see the decal be as white as you expected when you look at it in the BaseColor view mode. Tell me if that works and I'll tell you what happened.
  • frmdbl
    Options
    Offline / Send Message
    frmdbl polycounter
    @andrad
    Ok, you're damn right :)
  • andrad
    Options
    Offline / Send Message
    andrad polycounter lvl 5
    @frmdbl Nice. So, everything works as intended and what you were seeing was just the way that metals work in UE. You can confirm that by placing a plain old, regular metallic object in the scene and viewing it in unlit mode. It'll have the same grey color instead of a full white. Set metallic to 0 in the material and it will be white again. And because the decal response mode in the left screenshot ignores all metalness in decals, the decal was non-metallic and therefore fully white. Not so in the right screenshot, where metalness gets properly applied.

    I hope that solves your problems. Shout if there's anything else.
  • LVG
    Options
    Offline / Send Message
    LVG polycounter lvl 12
    Very cool work man, Would love giving this a try if my build didn't fail every time
  • andrad
    Options
    Offline / Send Message
    andrad polycounter lvl 5
    Heads up! A commenter in the UE4 forums brought to my attention that Epic finally did some work to integrate metallic & specular into DBuffer decals. They did it independently, though, so I had nothing to do with it.

    Here is a link to the forum post. And here is the commit on GitHub.
  • Menchen
    Options
    Offline / Send Message
    Menchen polycounter lvl 3
    @andrad In the recently released 4.21, if you take a look at the ush shader files (specially dbufferdecalshared.ush and decalcommon.ush), you can see that they not only implemented Metallic and Specular, they also have added multiopacity. You can see it in dbufferdecalshared line 31.

    However, for some reason, it doesn't do anything. It doesn't work. My guess is that the material editor stll handles the Opacity output as a single channel (it will always take the red channel if you try to input the three channels at once), but don't know where the problem actually is.
  • andrad
    Options
    Offline / Send Message
    andrad polycounter lvl 5
    @Menchen The multiopacity parameter has always been there. This is what I used as starting point for my changes to the rendering code. My guess is they started to implement proper multi opacity sometime in the past, but never finished it for some reason. All I did was kind of finishing it for them.
  • frmdbl
    Options
    Offline / Send Message
    frmdbl polycounter
    @andrad

    What's the state of it right now? Did they implement it in any release version of the UE?


  • GhosTDoG
    Options
    Offline / Send Message
    GhosTDoG polycounter lvl 6
    frmdbl said:
    @andrad

    What's the state of it right now? Did they implement it in any release version of the UE?


    Of course not ^^
    Unfortunately it became a running gag...quess you will never see Dbuffer AO and Metalness in UE4.

  • Geoffroy
    Options
    Offline / Send Message
    Geoffroy polycounter lvl 6
    I'm really interested in this workflow ^^. Is there any way to update this to the current engine version ? 
2
Sign In or Register to comment.