Announcement

Collapse
No announcement yet.

Too much transparency on water material after SteamVR build (DistanceToNearestSurface)

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

    Too much transparency on water material after SteamVR build (DistanceToNearestSurface)

    I couldn't really find anything related to this after a quick search, but I wasnt sure what to search for in the first place...

    Basically, I have a water shader that I franken-coded from different bits and pieces of nodes I found (some posted here included), that somehow ended up looking perfect against my own expectations. But after packaging the project for Windows 10, 64bit, the area of the shoreline which is supposed to subtly fade into transparency is much wider! It's really glaring and adjusting the variables on the fade doesnt seem to change much. The material is translucent, default lit, in a 14.4 project.

    In Editor:
    Click image for larger version

Name:	ey9ALKN.png
Views:	1
Size:	381.8 KB
ID:	1209049

    After Package:
    Click image for larger version

Name:	CUGkM8y.png
Views:	1
Size:	388.3 KB
ID:	1209050

    This is the part of the material that controls the shore transparency:
    Click image for larger version

Name:	udHar0x.png
Views:	1
Size:	89.7 KB
ID:	1209051

    I'm hoping it's just some setting in the packaging or along those lines, but I have no idea where to look. Can anybody help me find the issue?

    #2
    Is it allowed to bump? I'm terribly sorry, but I really have to figure out how to get this to work I would like to understand why it isn't working either, if there is any explanation for that. Would it perhaps make more sense to post this in the VR Development forum?

    Comment


      #3
      Distance fields are not yet supported in VR. It is likely that it is not updating the global clipmap position or something like that, so you end up seeing a lower res version. I would instead recommend using something like DepthFade to do the soft edge.
      Ryan Brucks
      Principal Technical Artist, Epic Games

      Comment


        #4
        Thank you very much! That was the push I needed It was much easier to implement the DepthFade than I thought. Now I only need to check if it still works after the build (when I have access to the Vive).

        One follow-up question though, if I may: A second effect I did with the DistanceToNearest node worked fine in the packaged Build. It would of course make sense to switch that one to DepthFade regardless, for a cleaner project; but it suffers from the problem that the view angle drastically changes the way the effect looks. Since my project is supposed to encourage move around and look at things from different angles, this is not feasible. Is there a way to "fix" the effect to one, perhaps simulated, viewing angle?

        Comment


          #5
          You can divide the depthfade width value by:

          Dot (CameraVector, VertexNormal).

          this is called 'perspective correction' and it will help, but may not be perfect since the ray will hit different geometry at different angles. but it will stabilize the case where the bottom is a plane parallel to the top perfectly.

          if you have quickly changing terrain height under the water, I suggest you instead bake out the gradient to a flat texture. The node "Landscape Manual UVW" can map it given specified min and max coords.
          Ryan Brucks
          Principal Technical Artist, Epic Games

          Comment

          Working...
          X