Announcement

Collapse
No announcement yet.

Custom Buffer output into post process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Custom Buffer output into post process

    Hi all

    I thought I'd make a new thread as the previous discussion I was having was over in the events section and it seems more relevant to have it here.

    I've managed to take advantage of the fact that there is a customData channel in the GBuffer which the Default Lit and Unlit shaders dont use. All of the others (clear coat, hair, subsurface) use it.

    I've added an output node int the material editor that lets you write whatever you want to it from a material.

    Click image for larger version

Name:	UE4Editor_2016-06-05_11-50-32.jpg
Views:	1
Size:	55.7 KB
ID:	1185479

    I throught from discussions on the forum that I would have to access this custom data through a custom node. Doing this was giving me a failed assertion that told me that the GBuffer resource wasn't valid. BUT then I had a look at the GBuffer visualisation and I saw my pass in the subsurface output! I then worked out that the customData get's written there and I wouldn't have to go through a custom node.

    Click image for larger version

Name:	UE4Editor_2016-06-05_11-58-01.jpg
Views:	1
Size:	52.7 KB
ID:	1185480
    Click image for larger version

Name:	UE4Editor_2016-06-05_12-14-28.jpg
Views:	1
Size:	64.8 KB
ID:	1185482

    It actually didn't take too much to do (well after having to figure out how the shader compiler works with all its defines when you add an output. I'm thankful for visual studios 'go to defintion' because documentation surely didn't help me.

    I can create a pull request for this. is this something that is likely to be accepted [MENTION=404]DanielW[/MENTION], [MENTION=3692]RyanB[/MENTION]? Or should I just keep my own custom build?

    The first thing that I can see people being worried about is mixing the subsurface output with these arbitrary ones. Well because the Gbuffer is limited in how many passes it can do (or more to the point how many epic want to put in for performance reasons), I don't see any extra custom passes being added. One workaround I have thought about it to use the stencil buffer to send material/mask IDs through so that you can do your own masking in post process. So all SS materials would be given a stencil id of 1 or something and anything else would be a custom thing. This would be up to the user though.

    I'm interested to hear everyone's thoughts on if this is a useful feature.

    Cheers
    Dan
    Last edited by dokipen; 06-04-2016, 08:15 PM. Reason: added PP image
    Visual Effects Artist, Weta Digital, Wellington New Zealand
    BLOG www.danielelliott.co.uk
    @danielelliott3d https://twitter.com/danielelliott3d
    Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
    2015 Showreel: https://vimeo.com/116917817

    #2
    I've gone ahead and create a pull request....

    https://github.com/EpicGames/UnrealEngine/pull/2476

    Feel free to leave feedback and requests.
    Visual Effects Artist, Weta Digital, Wellington New Zealand
    BLOG www.danielelliott.co.uk
    @danielelliott3d https://twitter.com/danielelliott3d
    Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
    2015 Showreel: https://vimeo.com/116917817

    Comment


      #3
      hi Dokipen, no link with this topic but i know your skills and i'd like to know if never know you can come and bring your talent here :
      https://forums.unrealengine.com/show...d-dynamic-wave , i guess for everyone working or loving modern 2D it can be very interesting.
      thanks in advance

      Comment


        #4
        Hi Dokipen, I found that trick with materials awesome because there isn't any way to pass custom data to post process from fragment shaders (materials) implemented by Epic Games, so, can I ask you if you could post the steps to create that node in materials, please?.

        Thanks in advance

        Comment


          #5
          HI DeleoDev.

          it required adding a few lines to the source code and recompiling. It was rejected on github and I haven't looked at it in a while. I heard that there was some change to the engine recently which allowed rendering code as plugins but I haven't looked into it. I'll have a look and see if its possible. In the meantime you are welcome to look at the pull request and get the code yourself if you want to compile it.

          https://github.com/EpicGames/UnrealEngine/pull/2476
          Visual Effects Artist, Weta Digital, Wellington New Zealand
          BLOG www.danielelliott.co.uk
          @danielelliott3d https://twitter.com/danielelliott3d
          Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
          2015 Showreel: https://vimeo.com/116917817

          Comment


            #6
            I've tried to visit the link but it gives me a 404 error. I think that they deleted your request

            Comment


              #7
              Originally posted by DeleoDev View Post
              I've tried to visit the link but it gives me a 404 error. I think that they deleted your request
              You need to connect your GitHub account to Epic one (int in the profile).

              dokipen Do you know if it's possible to write to custom buffers on recent UE4 versions?
              Twitter | MinimalUI UE4 Editor Theme
              Dark Themes for: Forum | AnswerHub | Everything else

              Comment


                #8
                This is interesting, but would it possible for you to hook customData node to PostProcessingInput5 or 6, rather than overriding SSS.

                Comment

                Working...
                X