Announcement

Collapse
No announcement yet.

Distance Field broken with Landscapes

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

    Distance Field broken with Landscapes

    So I followed RyanB and DanielW advice in their posts here.

    https://forums.unrealengine.com/deve...153#post491153

    I created a material with the DistanceToNearestSurface divided by 1000 and plugged into the Emissive channel. I set this material to both a landscape and a Floor static mesh (with
    Affect Distance Field Lighting turned off) to test. Finally I added two box static meshes to the scene and here is the result.

    Click image for larger version

Name:	1.png
Views:	248
Size:	46.3 KB
ID:	1439424
    As you can see, the distance field works fine on the Floor static mesh on the right, but is broken on the landscape on the left.

    You can see here that the mesh distance field looks correct.

    Click image for larger version

Name:	2.png
Views:	153
Size:	29.5 KB
ID:	1439425

    However, if I look at the global distance field, what is this?

    Click image for larger version

Name:	3.png
Views:	154
Size:	46.6 KB
ID:	1439426

    The landscape is a big blob in there, so I have a feeling the material is picking up on some distance field information from the landscape itself from this global distance field. Is this intentional or a bug?

    I couldn't find an Affect Distance Field Lighting option to turn off for the landscape, so is there some way to stop it adding to the global distance field?

    #2
    What version of the engine are you on? In older versions (can't remember exactly when) we didn't used to put landscape in the global distance field, which is what DistanceToNearestSurface looks up. Nowadays we do, and there's a cvar to control it: r.AOGlobalDistanceFieldRepresentHeightfields (set to 1 by default).

    Comment


      #3
      DanielW - I’m using the latest 4.18. Is there any side effect to turning this off for the landscape? I mean why is the landscape in the global distance field and what do I lose by turning off?

      On a side note; I know you can put console variables in the Engine/Config/ConsoleVariables.ini, but then that affects every project. So I put it in the Config/DefaultEngine.ini file of my project and that seemed to work. Is that the correct place to put them on a per project basis?
      Last edited by wilberolive; 03-07-2018, 07:32 PM.

      Comment


        #4
        Is there any side effect to turning this off for the landscape? I mean why is the landscape in the global distance field and what do I lose by turning off?
        You loose AO from landscape onto meshes in the scene from DFAO, if you have that enabled.

        So I put it in the Config/DefaultEngine.ini file of my project and that seemed to work. Is that the correct place to put them on a per project basis?
        IIRC putting them in DefaultEngine.ini requires being in a [SystemSettings] category, so the engine will actually parse those as cvars. Otherwise you need to use your project's DefaultScalability.ini.

        Comment


          #5
          I am going to add a bAffectDistanceFieldLighting to landscape so you can control this like you would on any static mesh, instead of using a global cvar.

          Comment


            #6
            Yes please. I actually looked for that option on the landscape before posting on the forum as I saw the static mesh had it.

            Comment


              #7
              Originally posted by DanielW View Post
              I am going to add a bAffectDistanceFieldLighting to landscape so you can control this like you would on any static mesh, instead of using a global cvar.
              Any ETA on this please?

              Comment


                #8
                sorry for unearthing this thread. but i just have to say "THANK YOU" this cvar saved my life. we still use 4.19 so this was great knowledge

                Comment


                  #9
                  I have this problem in 4.23, in the visualizer, i can see only 2 mesh i added to the character pb, i don't see it on landscape, or on character mesh
                  Attached Files

                  Comment

                  Working...
                  X