Announcement

Collapse
No announcement yet.

Shadow of the mesh changes after I build lighting

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

    Shadow of the mesh changes after I build lighting

    Hello.

    This is my mesh and its shadow before building the lights:




    This is my mesh and its shadow after building the lights:



    And these are the errors:



    The first error is what I don't understand.

    The second and the third one are weird: I imported my Torch from Maya, using a .fbx... so it's a static mesh itself LOL
    Last edited by gedamial; 06-02-2017, 05:04 PM.

    #2
    Shadows of stationary and static lights are baked into textures for the surfaces that catch the shadow. In this case it's baked as a texture for the wall. They're called lightmaps. In this case the wall lightmap resolution is simply too low to capture the fine detail of the shadow.

    The first issue can be solved by doing a proper UV map for the lightmap that the mesh will use https://docs.unrealengine.com/latest...ng/index.html#

    Comment


      #3
      Increase the lightmap resolution on the wall receiving the shadows. For the second issue, you need to find the object Torch_13 in the scene, the properties that you are pointing to in that screenshot will not have a mesh selected for that actor.

      Comment


        #4
        Originally posted by darthviper107 View Post
        Increase the lightmap resolution on the wall receiving the shadows
        How? I don't find the option clicking on the wall:

        Click image for larger version

Name:	kfYj2Fj.jpg
Views:	1
Size:	530.7 KB
ID:	1103002

        Comment


          #5
          You can check the box that says Override Lightmap Resolution and set it higher than the default

          Comment


            #6
            Originally posted by darthviper107 View Post
            You can check the box that says Override Lightmap Resolution and set it higher than the default
            Thanks, that solved the problem (i set 500, it's the only value that gives me a decent lightmap actually).

            While we're at it, can you explain me why this strangeness happens?

            I have a model, any model. Sometimes this model becomes darker than its original color. For example, see this chair:



            This is not its original color. But look at this.

            If I try to move A BIT the chair with the move tool... here it is:



            Et voilĂ . The chair is now as it should always be.

            Why this happens? This is not the first time it happens.
            I have at least 10 projects with UE4 and in all of them I face this issue.
            Last edited by gedamial; 06-02-2017, 12:46 PM.

            Comment


              #7
              Use a multiple of 2 for the lightmap resolutions, so 512 instead of 500, and you want to keep the resolution as low as possible since it increases memory usage (512 is a 512x512 pixel image)

              The reason it's dark like that is the lightmap resolution is low and the shadow is spready far across the surface because the pixels are big. When you move the object it invalidates the baked lighting so it's going back to dynamic or preview lighting until you bake the lighting again.

              Comment


                #8
                Originally posted by darthviper107 View Post
                Use a multiple of 2 for the lightmap resolutions, so 512 instead of 500, and you want to keep the resolution as low as possible since it increases memory usage (512 is a 512x512 pixel image)

                The reason it's dark like that is the lightmap resolution is low and the shadow is spready far across the surface because the pixels are big. When you move the object it invalidates the baked lighting so it's going back to dynamic or preview lighting until you bake the lighting again.
                Mhmm.. so how do I avoid that for every object in my game?

                Comment


                  #9
                  You would normally set the default lightmap resolution for the object by opening it from the content browser and then that setting would be applied to every copy you place in the level. The setting in the properties when you select the object in the map is an override setting that only applies to that copy of the object. If you want, you can select many objects at once and change the settings for them at the same time, or just change the static mesh itself so that it changes all of them. But again, you'll want to use the lowest resolution you can to save memory. Plus it will be faster to build lighting.

                  Comment


                    #10
                    Originally posted by darthviper107 View Post
                    You would normally set the default lightmap resolution for the object by opening it from the content browser and then that setting would be applied to every copy you place in the level
                    The chair and the other objects placed in the world already have a default lightmap resolution (override lightmap res. is unchecked).

                    As long as I rebuilt the lighting, all the objects get affected by that sort of darkness, and the only way to reset them is to move them one by one.

                    Harassing.

                    Comment


                      #11
                      You would either have to check that box and increase the lightmap resolution that way or find the mesh in the content browser and open it and change the default lightmap resolution there. If you move them that invalidates the static lighting and it goes to dynamic or preview lighting which is not good for performance or quality.

                      Comment


                        #12
                        Originally posted by darthviper107 View Post
                        You would either have to check that box and increase the lightmap resolution that way or find the mesh in the content browser and open it and change the default lightmap resolution there. If you move them that invalidates the static lighting and it goes to dynamic or preview lighting which is not good for performance or quality.
                        Two things:

                        1. I increased the Lightmap Res. of the chair, but after a Build Lighting I get the exact same issue.

                        2. So you're telling me I must set a higher resolution for every single object I introduce into the game?

                        Seems to be too tricky. It's not one of that issues that happens only in certain cirmustances.
                        It's a thing that happens even just by creating a new project and placing an object in it.
                        I mean, it's a so common issue that should've been resolved decades ago

                        However, no way to make this problem go away.

                        I also tried changing the Build settings from Preview to High.

                        Still no luck

                        Comment


                          #13
                          I don't think you're understanding.
                          When you place an object in the scene it will use preview lighting which is real-time just to give you a vague idea of what the lighting will look like. Once you build the lighting it will render the lighting to lightmaps which allows it to spend extra time to get more realistic lighting (calculating global illumination light bounce and all that). However, the amount of detail in your lightmaps is controlled by the lightmap resolution, which is literally an image of the lighting so a higher resolution gets better quality and detail but uses up more memory. Once the lighting is built, then if you move an object then the object will use preview lighting again and you will have to rebuild the lighting to see what the final result is. If you change a light then you will also have to rebuild the lighting.

                          When you import a mesh that you've made, it's in the content browser, you can double-click it and open the Static Mesh Editor, and from there you can set a default lightmap resolution. Once you do that, for every copy of that mesh that you place in your level it will use that resolution. If you change it in the content browser again it will update to all of the objects in the level (because they reference the mesh from the content browser). When you select an object in your level it will show properties for that object, from there there is the Override Light Map Res option which if you use it you can set a different lightmap resolution for the single object you have selected, all other copies will not use the override setting.

                          Comment


                            #14
                            Originally posted by darthviper107 View Post
                            I don't think you're understanding.
                            Same for you, mate:

                            Originally posted by gedamial View Post
                            Two things:
                            1. I increased the Lightmap Res. of the chair, but after a Build Lighting I get the exact same issue.
                            Still no luck
                            Other than increasing the lightmap resolution, what else should I do?
                            Also consider that we're not talking about a model of mine.
                            That chair is a built-in mesh, and its UVs is (or should be) perfect for a lightmap.

                            As stated in other threads, the lightmap in UE is really a joke

                            I'd like to see a huge update like this in the 4.11 version
                            Last edited by gedamial; 03-23-2016, 05:13 PM.

                            Comment


                              #15
                              Lightmaps are a pain, but that's the case for every engine that uses baked lighting, the real issue with UE4 lightmapping is that it takes shortcuts to improve lighting build times which cause some issues (seams) where you could bake lighting using something like Vray in a 3D application and not have the same issues as long as your lightmap is the right resolution though of course it would take longer.

                              As for your issue, you can still change the object in the content browser, when you use those assets they are brought into your project so you can change the settings for them if you wish. Still, the issue looks like the lightmap resolution is too low since it appears like there are large pixels causing those shadows to extend further than they should. It's possible that you're doing something wrong that isn't readily apparent--that's very common to happen and the only way to really know for sure would be to check the project myself.

                              Comment

                              Working...
                              X