Announcement

Collapse
No announcement yet.

Modular Asset Lighting Problem

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

    Modular Asset Lighting Problem

    Hello all! I just started working on my first set of modular assets (which are primarily different sized tiles) and I've gotten them to fit correctly and everything but now the problem is lighting. It is being lit differently on some tiles. Also, there are dark lines on some seams after building.
    Click image for larger version

Name:	HighresScreenshot00000.png
Views:	1
Size:	483.5 KB
ID:	1138930
    Click image for larger version

Name:	HighresScreenshot00001.png
Views:	1
Size:	489.4 KB
ID:	1138931
    Click image for larger version

Name:	HighresScreenshot00002.png
Views:	1
Size:	476.4 KB
ID:	1138932
    How would I fix this? Thanks!

    #2
    Hi,
    Make sure that your assets have a 2nd UVs channel, without overlapping.
    It's used to store the backed lighting map.

    Comment


      #3
      Originally posted by ZangouR View Post
      Hi,
      Make sure that your assets have a 2nd UVs channel, without overlapping.
      It's used to store the backed lighting map.
      I've already done this as well. This is what my both UVs channels look like:
      Click image for larger version

Name:	uv.png
Views:	1
Size:	503.7 KB
ID:	1057200
      Does it just need to be bigger or something? Thanks!

      Comment


        #4
        Originally posted by KoldKam View Post
        I've already done this as well. This is what my both UVs channels look like:
        Does it just need to be bigger or something? Thanks!
        You should have some padding between faces(3-4 grid pixel, where grid size = 1/lightmap resolution), also was your light builded in production mode?
        Last edited by dtx12; 09-28-2014, 10:51 PM.

        Comment


          #5
          The images above and below were built using production lighting. Is this what you mean by having padding?
          Click image for larger version

Name:	uv.png
Views:	1
Size:	597.9 KB
ID:	1057203

          If so, the problem is still occurring.
          Click image for larger version

Name:	HighresScreenshot00000.png
Views:	1
Size:	306.6 KB
ID:	1057201
          Click image for larger version

Name:	HighresScreenshot00001.png
Views:	1
Size:	308.2 KB
ID:	1057202

          Am I doing this correctly? Thanks!

          Comment


            #6
            By "padding" he meant the distance of the UV shells next to each other. If they are too close, one can influence the other, because it "bleeds" over the UV shell border. However, I think Lightmaps don't do that (happens with Diffuse though).

            The reason you see seams on your lightmap is because you haven't connected the UV borders. When you make UVs for diffuse textures it is fine to separate them, when you make them for Lightmaps, you need to keep your object in one piece, if possible. Whenever you get the black seams, try connecting the UVs to make a single UV shell for your lightmap. Generally, try keeping lightmap Uvs together.

            Comment


              #7
              Plan object seams to happen at corners / edges, not on a flat surface Reduce the smoothing done by lightmass in WorldSettings->Lightmass->IndirectLightingSmoothness. A value of .6 or so can work well. You might also need to jack up the IndirectLightingQuality to 2 or so to compensate for this.
              https://answers.unrealengine.com/que...lar-walls.html
              http://celestialarch.com
              Free UE4 things available. More coming

              Comment


                #8
                Depending on your lightmap resolution you can actually adjust the size of your grid in your modelling programs UV editor. Make sure ALL of your UV shells in your lightmap channel are snapped on the grid lines. It's really importing to snap your shells on the grid lines because that stops light bleed and will give a better visual improvement for seams. To adjust the size of your grid in your modelling apps UV editor just divide the lightmap resolution by 1 e.g. 1 / 64 = 0.015625, this would be the size of your grid if you want your lightmap res at 64 (which I've found gives good results). If you are using Maya then put this in your 'grid lines per unit'.

                Getting your grid size right will help you determine the padding issue that everyone is explaining above. You can use the grid to your advantage to easily spot padding issues between shells, 2 - 4 pixels (or grid lines) is a good place. If you are doing modular assets I would keep in mind texel density as well so that everything is consistent across your map.
                Last edited by ScrotieFlapWack; 09-29-2014, 05:39 AM.

                Comment


                  #9
                  To me, this looks like the result of the meshes being rendered in separate threads...

                  Comment


                    #10
                    Some of this information was covered above. There are ways to help alleviate and reduce this.

                    I'm going to be a little redundant here but just to make sure that a lot of the information is condensed into a single post.


                    1) Make sure you have a second UV setup specifically for your Lightmap.

                    2) (This is for modular hard edges like walls) Set up your grid spacing in your UV and snap the vertices to them.

                    - Target a LM Resolution (If you target 64 you can adjust higher via power of two and you will not have to manually target each LM specifically)
                    - Use the following formula to get the grid spacing for your UV: 1 / [LM Resolution] = Grid Spacing ie. 1 / 128 = 0.0078125
                    - any edge that is not snapped along a grid line can be shadowed. This is why there will sometimes be jaggies or artifacts with the shadows

                    3) For modular walls, the recommended workflow to not have seams is to have other meshes that cover this area or to have your edges meet at corners.

                    4) If not your workflow, you can reduce the edge seams by doing the following. Some of these settings WILL increase light build times.

                    - Place a lightmass importance volume in your scene covering your playable area.
                    - Under World Settings you can adjust the following:
                    -Indirect Lighting Quality 2 or higher should work (may need to be higher up to 4 but will increase light build times)
                    -Indirect Lighting Smoothness to 0.6.
                    -(Optional) Environment Color - change to anything other than full BLACK. This will lighten your shadows and increasing it just a little in the grey side will help sometimes.

                    If this isn't working for you the last option is to adjust Static Lighting Level Scale under World Settings. Default is 1.0. If you adjust this lower you can get better results. This will significantly increase light build times in some cases. This is the scale which light is build. Default is the current UE4 scale of 1 unreal unit = 1cm.


                    Using these methods should help in going a long way to get the results you're looking for.

                    Feel free to ask any questions you may have.

                    Tim
                    Tim Hobson | Learning Resources | Epic Games
                    UE4 Documentation
                    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                    _____________________________________________
                    Follow me on Twitter @TimHobsonUE4 | My Personal Website
                    Photons Be Free: Mini-Tutorials and other Curiosities

                    Comment


                      #11
                      Originally posted by Tim Hobson View Post
                      Some of this information was covered above. There are ways to help alleviate and reduce this.

                      I'm going to be a little redundant here but just to make sure that a lot of the information is condensed into a single post.


                      1) Make sure you have a second UV setup specifically for your Lightmap.

                      2) (This is for modular hard edges like walls) Set up your grid spacing in your UV and snap the vertices to them.

                      - Target a LM Resolution (If you target 64 you can adjust higher via power of two and you will not have to manually target each LM specifically)
                      - Use the following formula to get the grid spacing for your UV: 1 / [LM Resolution] = Grid Spacing ie. 1 / 128 = 0.0078125
                      - any edge that is not snapped along a grid line can be shadowed. This is why there will sometimes be jaggies or artifacts with the shadows

                      3) For modular walls, the recommended workflow to not have seams is to have other meshes that cover this area or to have your edges meet at corners.

                      4) If not your workflow, you can reduce the edge seams by doing the following. Some of these settings WILL increase light build times.

                      - Place a lightmass importance volume in your scene covering your playable area.
                      - Under World Settings you can adjust the following:
                      -Indirect Lighting Quality 2 or higher should work (may need to be higher up to 4 but will increase light build times)
                      -Indirect Lighting Smoothness to 0.6.
                      -(Optional) Environment Color - change to anything other than full BLACK. This will lighten your shadows and increasing it just a little in the grey side will help sometimes.

                      If this isn't working for you the last option is to adjust Static Lighting Level Scale under World Settings. Default is 1.0. If you adjust this lower you can get better results. This will significantly increase light build times in some cases. This is the scale which light is build. Default is the current UE4 scale of 1 unreal unit = 1cm.


                      Using these methods should help in going a long way to get the results you're looking for.

                      Feel free to ask any questions you may have.

                      Tim
                      Hey, so I went back into 3DS Max and re-created all my lightmaps. Here's one in 3DS Max:
                      Click image for larger version

Name:	uv.png
Views:	1
Size:	228.2 KB
ID:	1057222
                      Click image for larger version

Name:	options.png
Views:	1
Size:	23.5 KB
ID:	1057223
                      As you can see, I have them snapped onto the grid lines and everything (I hope lol). This is what I have now:
                      Click image for larger version

Name:	HighresScreenshot00000.png
Views:	1
Size:	405.4 KB
ID:	1057224
                      Click image for larger version

Name:	HighresScreenshot00001.png
Views:	1
Size:	388.0 KB
ID:	1057225
                      Click image for larger version

Name:	HighresScreenshot00002.png
Views:	1
Size:	285.2 KB
ID:	1057226
                      Click image for larger version

Name:	HighresScreenshot00003.png
Views:	1
Size:	373.7 KB
ID:	1057227
                      I think it looks a little better now. All of my wall tiles are using the same material, but it still looks like some are different colors.

                      @Tim I've tried changing my world settings, and they still look different.

                      Now if I can get them to look the same color, I'll be all good.
                      Last edited by KoldKam; 09-29-2014, 06:29 PM.

                      Comment


                        #12
                        Forgot to add this, but I've lowered the Static Lighting Level Scale to 0.1 and this is the result:



                        It looks a lot better, but in dark corners it looks weird. lol

                        Comment


                          #13
                          Hi,

                          when you snap your UV islands to the grid, make sure you have
                          - a texture with that resolution showing in the UV editor (even if you unwrap UVs. the texture is just used as a dummy, see below)
                          - you have activated the snapping, which you have not in your screenshot:

                          Click image for larger version

Name:	uveditor.jpg
Views:	1
Size:	69.6 KB
ID:	1057235

                          You have to click the button and hold (the snap button is a fly out one). Just look for that snappy little box

                          Click image for larger version

Name:	uvsnap.JPG
Views:	1
Size:	14.1 KB
ID:	1057236

                          Here is the trap: You must do both of the above. Forget either to select and show a texture, or forget "activate" the snapping mode
                          and snapping will not work.

                          That checker like shading pattern... Is that consistent with the modular mesh geometry?
                          If so, it is caused by the lightmass parallel baking process. These artefacts can be attenuated and/or obscured by additional geometry, but not fully avoided.

                          Cheers,
                          Klaus
                          Last edited by KVogler; 09-29-2014, 10:05 PM.

                          Comment


                            #14
                            Originally posted by KoldKam View Post
                            Hey, so I went back into 3DS Max and re-created all my lightmaps. Here's one in 3DS Max:


                            As you can see, I have them snapped onto the grid lines and everything (I hope lol). This is what I have now:




                            I think it looks a little better now. All of my wall tiles are using the same material, but it still looks like some are different colors.

                            @Tim I've tried changing my world settings, and they still look different.

                            Now if I can get them to look the same color, I'll be all good.
                            It looks like your Lightmap in the above screenshot still doesn't have very good padding. Anything that is near the edge of the 0 - 1 UV space still needs to have padding. Lightmaps aren't like texture UV's. If you move all your shells that are near the edge of the 0 - 1 UV space and give everything around a 2 - 4 pixel space then that will definitely make your walls look a little better. Just some more tips, the orientation of your shells doesn't matter with lightmaps so you can squeeze whatever space you can from your lightmap. You can scale down your shells a little smaller (if your going to be using a 64 resolution on your lightmaps) this should help you get more space to layout your shells and give everything 2 - 4 pixel spacing.

                            Everything that will be facing the same direction can be sewn together. By this I mean let's say your modular walls get bigger, then if you have 2 parts of your wall that are going to be facing the same way (pointing in the same direction) then you can sew those parts together. Anything that isn't facing the same way you will have to give it's own space on your lightmap. This may not apply to a majority of your models if you are going modular but it is good to know (I will try to get some screenshot examples for you so it will explain all this a little easier).
                            Last edited by ScrotieFlapWack; 09-30-2014, 03:16 AM.

                            Comment


                              #15
                              Hi KoldKam,

                              To better illustrate, I've setup a simple scene similar to yours with a single wall mesh where I can visibly see the modular wall seams.

                              This should help with seeing how to get rid of seams. This will still not get rid of them fully and this is why the recommended workflow is to have your walls as one single piece, use other meshes to cover seams, have your meshes seams meet at corners, or use the World Settings > Lightmass section to help reduce the seams.

                              In my following examples I've made a simple wall mesh.

                              LxWxH: 300x200x20 cm

                              I've set the lightmap UV to target a 64 lightmap resolution. I've set my UV grid for my UV to 0.015625 for vertex snapping.
                              I've placed a light in the scene with a intensity of 3500. Everything else is default.

                              WARNING!
                              Increasing some of these settings below will significantly increase light build times!!

                              In this first image here are my settings:

                              LM Resolution: 64
                              Light Build Quality: Preview

                              Click image for larger version

Name:	LM1_64_Pre_noChanges.PNG
Views:	1
Size:	813.9 KB
ID:	1057245


                              In this second image here are my settings:

                              LM Resolution: 64
                              Light Build Quality: Production

                              World Settings:
                              Indirect Lighting Quality: 2
                              Indirect Lighting Smoothness: 0.6

                              Click image for larger version

Name:	LM_64_Pro_WorldSettings.PNG
Views:	1
Size:	847.5 KB
ID:	1057246


                              In this third image here are my settings:

                              LM Resolution: 64
                              Light Build Quality: Production

                              World Settings:
                              Static Lighting Level Scale: 0.1
                              Indirect Lighting Quality: 2
                              Indirect Lighting Smoothness: 0.6

                              Click image for larger version

Name:	LM_64_Pro_scale.PNG
Views:	1
Size:	837.8 KB
ID:	1057247



                              Attached below is my simple scene I've set up with the wall mesh.

                              https://www.dropbox.com/s/jk99sjq0d4...Seams.rar?dl=0


                              This scene is setup using the final settings in the above image.

                              There are a few artifacts in some corners, but this should be able fixed by adjusting the LM resolution up.

                              While this is a simple setup, by having a good UV layout with padding between UV islands can help get better results.

                              Tim




                              [/URL]
                              Last edited by Tim Hobson; 09-30-2014, 11:17 AM.
                              Tim Hobson | Learning Resources | Epic Games
                              UE4 Documentation
                              Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                              _____________________________________________
                              Follow me on Twitter @TimHobsonUE4 | My Personal Website
                              Photons Be Free: Mini-Tutorials and other Curiosities

                              Comment

                              Working...
                              X