No announcement yet.

Weird Lightmap generated in static meshes converted from CSG

  • 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.

    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.


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


      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.


        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:

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

        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.



          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.


            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!!


              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:

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


                In fact, looking at this image [], 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.


                  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:


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


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


                  After that, the lightmap generated was much better:


                  But in the darker zones there is a similar problem:


                  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