Announcement

Collapse
No announcement yet.

Weird Lightmap generated in static meshes converted from CSG

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

    Weird Lightmap generated in static meshes converted from CSG

    Dear all,

    I am currently creating one level from UDK brushes. Once converted to static meshes everything works fine except the step of generating lightmap. Please, see link below.

    http://freel4nce.com/lightmapProblem.png

    As you can see, lightmap looks like "burned" (in the moment of the screenshot, the mesh was selected, sorry for that). The static mesh has lightmap in channel 1 (generated with UDK) and Light Map Coordinate Index is correctly set with an acceptable lightmap resolution (I have tried from 32 to 2048 with almost the same result). Also, the Static Mesh Component has the supposed correct parameters.

    In addition, before converting to static meshes, I have tried to reduce light map parameter from 32 to 5 in surface properties of each brush with almost the same result. Generating lightmap for brushes gives similar results. The material used is only a texture of 256x256 applied to the diffuse channel. Could it be this tiny texture the problem?

    I am working using mobile compatibility, disabling it gives very similar results. Also, I have tried with all levels of quality of light generation, from preview to production.

    Thanks

    #2
    I would unwrap the UV's for the lightmap in a different program. Looks like they aren't ideal from UDK

    Comment


      #3
      Yeah that lightmap uv set looks awful. Try adjusting the settings for the auV generation to use less shells.

      Better yet, don't convert BSP to static meshes. Usually doesn't turn out well.

      Comment


        #4
        First of all, thanks for your helpful replies . I have done what Jessie suggested and, at least, now it seems I have good UV coordinates, as you can see here:

        http://freel4nce.com/lightmapProblem2.png

        However, the results are pretty the same , here you can see the problem more detailed, before and after building light:

        http://freel4nce.com/lightmapProblem1.png

        It does not seem a problem of converting CSG to static meshes but a problem with lighting, since building light in the CSG level give very similar results.

        Thanks!!

        Comment


          #5
          Try separating it some. You're trying to pack all of those walls into a single UV layout for the lights. If you convert it to multiple meshes, maybe 2 or 3, you'll have more room in the lightmap UVs and better resolution.

          Comment


            #6
            It's true what you say, having a whole room in a single static mesh is not feasible. But I think that the problem of the "burned texture" is related to the material I use for the walls. The texture is a unique color (#FEF8C7), it seems that applying the low-resolution lightmap spoils the result, could it be? Using a high-resolution lightmap makes the artifacts smaller, but still present. Also, I used materials that come by default in UDK and the texture is not burned to that level. I think I will redo all my work in 3dmax to achieve better lightmaps. Thanks for the help, after tens of hours with this I was beginning to see the face of Christ in the burned walls!!

            Comment


              #7
              Resolution can help this, but you are running into one of the quirks of UE3 Lightmass. This might actually be values in the diffuse texture being bounced around the scene.

              Because of how the Lightmass particle model is setup, diffuse textures with saturated noise (hello JPEG artifacts!), or super-dark/saturated areas will bounce those distinct colors around the environment. So the problem (probably) lies in your texture (which may be low-resolution, have JPG artifacts, or have IRL lighting information "baked in", or possibly a "gamma problem").

              One option would be to really dig into the Lighting *.ini setting and other preferences, where there is an option for increasing the number of photon-particles used to bounce indirect lighting information around the scene. This, plus the higher-res lightmaps will help "smooth" those errors into more realistic lightblending.

              Other than that, test it with a different material and flip through the different lighting modes in UDK. If you can see saturated colors in those "error patterns" while in Lighting Only mode, then it's probably those problems with the diffuse texture.

              See the Lightmass references here:
              http://udn.epicgames.com/Three/Light...with Lightmass

              [Edit: oops, wrong URL there for a second...]

              Comment


                #8
                In fact, looking at this image [http://freel4nce.com/lightmapProblem1.png], these are definitely problems outside of the directly illuminated area as they only appear on your "small" light setup (they go away when the light radius is bigger than the room, right?). That's another indicator that Lightmass' bounce engine is having problems with something in the scene.

                Comment


                  #9
                  Thanks Joshua!! Effectively, it seems that it is a problem with the material. This is what I did to check it:

                  Here is an image using my material (left) and a Udk one (right) with light only mode:

                  http://freel4nce.com/lightmapProblem3.png

                  There are not such burned area in the bricks. Here is my material:

                  http://freel4nce.com/lightmapProblem6.png

                  I copy-pasted part of the bricks-material from UDK in my material:

                  http://freel4nce.com/lightmapProblem5.png

                  After that, the lightmap generated was much better:

                  http://freel4nce.com/lightmapProblem7.png

                  But in the darker zones there is a similar problem:

                  http://freel4nce.com/lightmapProblem8.png
                  http://freel4nce.com/lightmapProblem9.png


                  These lighting results were generated with medium quality, the meshes are CSG brushes with a lightmap quality of 5 (the default was 32). I also have the same problem with static meshes imported from 3DSmax.

                  It seems that there is the same error but hidden by the normal map, doesn't it? Should I create a blank normal map for my material?

                  I also modified lightmass parameters like diffuse boost, tried to create a post processing volume with no success. Is this the best result I can achieve? Is it impossible to get almost the same quality as dynamic light gives?

                  Thanks for your help

                  Comment

                  Working...
                  X