Announcement

Collapse
No announcement yet.

Water foam using distance fields

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

    #16
    Slightly unrelated question but is there a way to disable distance fields for a specific mesh in the environment?

    Comment


      #17
      Not really. Theoretically with project settings disabled and on mesh editor enabling mesh distance fields for that specific mesh should work, but doesnt. The only way, not a perfect one, is to use the mesh instance position and the mesh bounds multiplied by its scale, to create a sphere mask or box mask and cut it out of the result, at least the cost is quite cheap.
      Nilson Lima
      Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
      Join us at Discord: https://discord.gg/FUwTvzr

      UE4 Marketplace: Cloudscape Seasons
      supporting: Community FREE Ocean plugin

      Comment


        #18
        Originally posted by NilsonLima View Post
        Not really. Theoretically with project settings disabled and on mesh editor enabling mesh distance fields for that specific mesh should work, but doesnt. The only way, not a perfect one, is to use the mesh instance position and the mesh bounds multiplied by its scale, to create a sphere mask or box mask and cut it out of the result, at least the cost is quite cheap.
        IIRC,Set Distance field resolution scale to 0 works for me in earlier version.

        Comment


          #19
          Originally posted by profhua View Post

          IIRC,Set Distance field resolution scale to 0 works for me in earlier version.
          Is that a global setting that applies to all instances of whatever mesh you set it for or can be 2 instances of the same mesh have different DF settings?

          I ask because I created a really cool effect for water flowing past rocks as a backup effect if I couldn't get distance fields to work. I'd like to combine the 2 effects so that Distance fields are used for landscapes, large objects such as rocks, and the player (I don't think skeletal meshes even have distance fields so that might not even be possible) and then a custom effect for other objects.

          Comment


            #20
            Originally posted by KrunkFu View Post

            Is that a global setting that applies to all instances of whatever mesh you set it for or can be 2 instances of the same mesh have different DF settings?

            I ask because I created a really cool effect for water flowing past rocks as a backup effect if I couldn't get distance fields to work. I'd like to combine the 2 effects so that Distance fields are used for landscapes, large objects such as rocks, and the player (I don't think skeletal meshes even have distance fields so that might not even be possible) and then a custom effect for other objects.
            It's a global setting for the mesh,but you can duplicate the mesh since it's not costly.And skeletal meshes don't have distance field yet.Once I used a masked cylinder mesh instead in the player BP for interactive grass.

            Comment


              #21
              Originally posted by profhua View Post

              It's a global setting for the mesh,but you can duplicate the mesh since it's not costly.And skeletal meshes don't have distance field yet.Once I used a masked cylinder mesh instead in the player BP for interactive grass.
              I might have to do that for the water. For my grass I use a sphere mask to add some offset near the character. This works great for short grass but not for larger foliage. For the larger plants I just convert them to physics assets when the player gets close enough to interact with them and then replace them with a static instance when they walk away. Its a bit expensive but looks so **** good.
              Last edited by KrunkFu; 03-10-2018, 04:57 AM.

              Comment


                #22
                Originally posted by KrunkFu View Post
                I'm trying to create water foam using distance fields. I've seen tons of people do it but for some reason I can't replicate the result. What am I doing wrong?

                Here are a few example of people that have done it:
                https://80.lv/articles/working-on-water-shaders-in-ue4/
                I tryied to recreate this one but without the same results. Screenshot resolution is too low so I can't see everything
                I guess the connection between "Animated Rim" part and "RimColor" part is a "ADD" node but note sure at all. Not sure neither about the "RimTexture", I guess it's some vertical stripes.
                Plus I guess the effect works only with some specific float values but it's hard to read them.


                Comment


                  #23
                  Originally posted by KrunkFu View Post
                  I just got my friend to recreate it and it worked for him. For some reason it wont work for me regardless of what version of the engine I try it in. I'm more confused now than I was before.
                  It only works in DX 11 and above.

                  Comment

                  Working...
                  X