Announcement

Collapse
No announcement yet.

Lightmass volumetric lightmaps do not work with Landscape UVs

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

    Lightmass volumetric lightmaps do not work with Landscape UVs

    Hi,

    I was just doing some experiments with lightmass when I noticed something very surprising. I was testing how well volumetric lightmaps work to capture light bounced off of landscape for moving objects, and I noticed that lightmass completely ignores UV mapping of the landscape, be it modified or default, and instead samples the textures on landscape in some arbitrary random UV space, which doesn't match the actual UV mapping you see. :O Here are some examples:

    Click image for larger version  Name:	fail1.JPG Views:	1 Size:	461.8 KB ID:	1579473
    Click image for larger version  Name:	Fail2.JPG Views:	1 Size:	471.7 KB ID:	1579474

    I tried some modifications to both TextureCoordinate and LandscapeCoords, like rotations, different sizes, and they did affect the result of volumetric lightmap every time, but also, they never actually matched the surroundings.

    What this pretty much means is that everyone who ever used volumetric lightmap on landscapes ever since this broken has likely got a very wrong results :O
    Last edited by Rawalanche; 02-01-2019, 09:10 AM.
    https://www.artstation.com/artist/rawalanche

    #2
    Thats very interesting! Can someone verify that?
    Check out UNREAL 4 Lighting Academy
    https://forums.unrealengine.com/show...ng-like-that-)

    Comment


      #3
      Originally posted by Daedalus51 View Post
      Thats very interesting! Can someone verify that?
      I have made a small, simple test project so that you can try to reproduce it yourself, and make sure I did nothing wrong. It's here:
      https://drive.google.com/open?id=1Xb...Qt5re7D6eyISIi

      This is a picture of a flat landscape:
      Click image for larger version

Name:	Landscape.JPG
Views:	1
Size:	181.7 KB
ID:	1579549 And this one is after replacing the landscape with mesh plane of the exact same size:
      Click image for larger version

Name:	MeshPlane.JPG
Views:	1
Size:	200.3 KB
ID:	1579550 So the volumetric lightmap itself works, but when it comes to landscapes, it samples something completely weird. It definitely doesn't sample the result you see.
      https://www.artstation.com/artist/rawalanche

      Comment


        #4
        Heh,

        I am surprised people have so little interest in something so breaking. I guess game people don't really give a **** about if indirect lighting is right or not
        https://www.artstation.com/artist/rawalanche

        Comment


          #5
          You should make a Bug Submission!

          Comment


            #6
            Originally posted by Raildex_ View Post
            You should make a Bug Submission!
            That's my plan. But I want to first verify I did not make any mistake on my side, because I just struggle to believe no one noticed something so crucial to game visuals yet so broken. :| Once someone independently verifies it's really not an user/setup mistake, I'll make the bug report.
            https://www.artstation.com/artist/rawalanche

            Comment


              #7
              So, I have taken a time to create quite elaborate bug report with example project and many screenshots. I have taken quite some time to get it right.

              This is what I got back: Click image for larger version  Name:	bugreport.JPG Views:	1 Size:	28.6 KB ID:	1584028 The person on the other end did not even bother to read it carefully enough to realize it's not a volumetric light probe placement issue, but issue with the colors that the light probes gather. So obviously bCullBricksBelowLandscape does nothing.

              So, in the end, there is currently no way to use volumetric lightmass with landscape in UE4. Which means there is currently no way to get proper indirect illumination from the landscape on any movable objects. And this issue probably won't be solved anytime soon, if ever. Ultimately, if you have any project which includes landscape and movable objects, you can forget about indirect illumination. Even baked lightmass one.
              https://www.artstation.com/artist/rawalanche

              Comment


                #8
                uhh this is unsettling

                maybe if we ping JackP or RyanB they might have a different opinion than this Trey
                Follow me on Twitter!
                Developer of Elium - Prison Escape

                Comment


                  #9
                  So apparently the issue goes even deeper than that. I've made one of the objects on the landscape static, and the baked lighting on it has wrong bounce color as well.
                  Click image for larger version  Name:	Lightmass.JPG Views:	1 Size:	249.8 KB ID:	1584150
                  So this doesn't only affect volumetric lightmass bounces from landscape, but all bounced light from landscape, including baked one on static objects. But I would still very much appreciate if someone grabbed the project and verified it independently https://drive.google.com/open?id=1Xb...Qt5re7D6eyISIi because I am not that experienced with lightmass.
                  https://www.artstation.com/artist/rawalanche

                  Comment


                    #10
                    Ouch. This is pretty serious - have you tested this on an older version of the engine?

                    Comment


                      #11
                      Since GPULightmass also relies on the original Lightmass's material export, I modified GPULightmass to let it output diffuse channel to the lightmap, and this is how the material is exported:

                      Click image for larger version

Name:	TIM截图20190213093153.png
Views:	1
Size:	568.7 KB
ID:	1584172

                      Comment


                        #12


                        Originally posted by ambershee View Post
                        Ouch. This is pretty serious - have you tested this on an older version of the engine?
                        Honestly, not yet.... I don't have older ones installed, but I'll have to bite the bullet.

                        Originally posted by Luoshuang View Post
                        Since GPULightmass also relies on the original Lightmass's material export, I modified GPULightmass to let it output diffuse channel to the lightmap, and this is how the material is exported:

                        Click image for larger version  Name:	TIM截图20190213093153.png Views:	1 Size:	568.7 KB ID:	1584172
                        Ouch....
                        https://www.artstation.com/artist/rawalanche

                        Comment


                          #13
                          Ok I think I got a quick workaround for this problem:

                          Engine\Source\Editor\UnrealEd\Private\Lightmass\LightmassLandscapeRender.cpp: 73

                          Code:
                          const FVector2D BaseLayerCoords = FVector2D(UVSubsection) * LayerScale;
                          change to:

                          Code:
                          const FVector2D BaseLayerCoords = FVector2D(LandscapeComponent->SectionBaseX, LandscapeComponent->SectionBaseY) + FVector2D(UVSubsection) * LayerScale;
                          Tested works with LandscapeCoords and TexCoords, unsure about whether it has some side effects

                          Comment


                            #14
                            Hmm... if I remember correctly, landscape is being broken into separate components before sent to lightmass. So I guess the issue is that the separate components are then starting their own UV coordinates from their local corners instead of the global UV coordinates of the entire landscape component array.
                            https://www.artstation.com/artist/rawalanche

                            Comment


                              #15
                              Originally posted by Rawalanche View Post
                              Hmm... if I remember correctly, landscape is being broken into separate components before sent to lightmass. So I guess the issue is that the separate components are then starting their own UV coordinates from their local corners instead of the global UV coordinates of the entire landscape component array.
                              Yep I believe thats indeed the problem - so the workaround I posted adds the base offset of each component.

                              Comment

                              Working...
                              X