Announcement

Collapse
No announcement yet.

Translucent Water Material - Displacement Banding Issue

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

    #16
    DotCam / TheBeeg,

    Did your fix eliminate translucency artifacts completely or are they still there and you have to be conservative with your wave settings?

    I believe I have everything set up precisely and even have a scalar param linked to the custom
    depth node so I can tweak the *0.999 threshold. The parameter is working because ramping it up
    gradually truncates the Z depth of the ocean.

    My 2nd mesh/material is in sync with the main material, confirmed by toggling the pass/visibility.

    Despite this, 0.0 to 0.999 has no effect on the artifacts.
    I'm not sure if there is more that can be done or whether the artifacts you see (screenshot)
    are the best I'll get out of UE4 w.r.t the deferred rendering limitations.

    Click image for larger version

Name:	TranslucencyArtifactWithWorkaround.jpg
Views:	1
Size:	828.8 KB
ID:	1097453

    Comment


      #17
      Mega bump, but at least in UE 4.13, I cannot for the life of me find that "World to View" node used up there. Was it removed? Am I just being dumb? O.o

      Comment


        #18
        It should just be a setting on the "Transform" node, setting the transform settings to be World and View respectively.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


          #19
          Originally posted by The Beej View Post
          This is probably caused by the fact that transparent materials don't write to the depth buffer. This means that when a closer wave is occluding a further wave, which one ends up on top depends on the order in which the GPU renders them. Fixing this is harder than it should be because Unreal doesn't seem to have a depth only material domain and it doesn't write custom depth for meshes with transparent materials. So you'll need to make a few things: an opaque material that does your wave vertex displacement only, and a blueprint that has an extra ocean mesh component placed exactly on top of the original component, and a few extra nodes in your current ocean material. On the extra mesh, you want to use the opaque vertex displacement only material, mark it Render Custom Depth, and not Render in Main Pass. This will write your oceans mesh into the custom depth buffer. Now in your normal transparent ocean material, add these nodes to depth test against the custom depth buffer:

          [ATTACH=CONFIG]12777[/ATTACH]


          Note that this depth test is far from perfect but it should be good enough for what you need.
          Hey guys,

          I know this is an old post but I'm just wondering if the solution provided by The Beej would still be a good solution for this issue? Or has the engine been modified since the original post to make this more straight forward? (outside of now being able to write translucent materials to the depth buffer). Secondly - could anyone share any code/pseudocode for the HLSL in the custom node from the above BP example?

          Thanks,
          iGeordie

          Comment


            #20
            Originally posted by iGeordie View Post

            Hey guys,

            I know this is an old post but I'm just wondering if the solution provided by The Beej would still be a good solution for this issue? Or has the engine been modified since the original post to make this more straight forward? (outside of now being able to write translucent materials to the depth buffer). Secondly - could anyone share any code/pseudocode for the HLSL in the custom node from the above BP example?

            Thanks,
            iGeordie
            It is not a good a solution, yet still the only one available in stock engine. What changed since then, is that materials with translucent materials can write to custom depth and it is unnecessary to duplicate the object. Custom node code is there on the screenshot.

            Comment


              #21
              Originally posted by Deathrey View Post

              It is not a good a solution, yet still the only one available in stock engine. What changed since then, is that materials with translucent materials can write to custom depth and it is unnecessary to duplicate the object. Custom node code is there on the screenshot.
              Thanks for the heads up. I tried the above and when it wasn't working i assumed the commented HLSL was just a hint or such. Turns out I had set "Render Custom Depth Pass" on the mesh, but not "Allow Custom Depth Writes" on the material - all good

              Comment

              Working...
              X