Announcement

Collapse
No announcement yet.

Dirty lightmap

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

    Dirty lightmap

    Hello Epic Games Community,

    I have recently started making models with Blender and now I'm stuck at getting the lightmaps to work properly in UDK.
    After importing one of my meshes to UDK with textures, lightmap and building the lighting - the result is terrible.

    I know a lot of it probably has to do with bleeding and padding issues in the lightmap, but then there's also
    things that make no sense to me at all:
    - The lighted static mesh looks dirty overall, like it's been through a chimney
    - I see weird spots with lighting on them, than can not have been from just bleeding issues

    Without luck, I have tried numerous things such as:
    - triangulating the mesh
    - recalculating the normals
    - unwrapping the lightmap in all ways Blender has to offer
    - fbx export
    - ase export
    - manually made lightmap

    No overlapping parts in the lightmap.

    I've made some screenshots to clarify:

    The model in UDK with textures:


    The model in UDK without textures, just the lighting details:
    (front)

    (back)


    The settings in the UDK Content Browser:


    The UV-layout for the textures:


    The UV-layout for the lightmap:


    Any help is greatly appreciated.

    Thanks in advance,

    Meshedpotato

    #2
    Change the lightmap resolution to at least 512 for that model - Its currently set to 64 which is very low for that model

    Comment


      #3
      Maybe you can try merging together some adjacent faces in the lightmap-UV? You have many many separate patches.. Bringing them together will help you using the available space better.
      Argh, there was a tutorial somewhere, explaining many aspects of "designing" lightmap-UVs... The fact is, that in the lightmap-UV it is more advantageous to have less separate patches than having them "non-stretched". If you merge the faces together you will definitely get some stretching of some UVs but this is not really visible in the lightmapped render (as the lighting-information is "stretched" accordingly by the engine) but you get less issues by bleeding of separate patches.. Especially when the lightmap resolution is rather low..

      EDIT: Ah, here, for instance:
      http://udn.epicgames.com/Three/LightMapUnwrapping.html

      Comment


        #4
        On a side note, the shading is completely off. Add some hard edges or edge loops for proper smoothing.

        Comment


          #5
          I've largened the resolution from 64 to 512 ( even to 1024 for the last one )
          This is what I got so far:
          Left: original mesh with 512 resolution
          Middle: mesh with sharpened edges with 512 resolution (no significant change)
          Right: mesh with edge split modifier with 1024 resolution
          (front)

          (back: reversed order!)


          As you can see the right is way better than the other ones but still looks glitched and dirty, notice the round black spot on the top of the mesh in the latest image. Somehow UDK gave we me the "overlapping UVs" warning with the latest mesh although I did not get this warning before.
          What's going on?

          Comment


            #6
            Originally posted by Meshedpotato View Post
            Somehow UDK gave we me the "overlapping UVs" warning with the latest mesh although I did not get this warning before.
            What's going on?
            that's probably due to the edge split modifier adding verts, it might be better to flat shade some of the faces or actually split the mesh at the edges, doing either would add verts to your model but as the edge split modifier add verts anyway it wouldn't make any real difference in performance but it might get better results although you might need to redo parts of your lightmap depending on how you unwrapped it.

            Comment


              #7
              So much for redoing the lightmap UV and smoothing groups.
              Old (left) New (right)
              http://imageshack.us/a/img837/801/e6v.png
              The old one is with smoothing groups and the original lightmap.
              The right one has no smoothing groups at all and a minimum of 'islands' in the Lightmap.
              The problems persist, it looks slightly worse even.
              I don't actually use the build-in Lightmap pack of Blender but I made them manually, if that is relevant info.

              I'm willing to send the files if anyone is interested in helping me solve the issue.
              Does anyone know why the model keeps looking so polluted?

              Comment


                #8
                My question for you is, is this a clean install of the UDK?. Meaning everything is default, you did not change any setting anywhere?.

                Assuming it's clean......

                Something I know can cause bad results is the normal influence on the light bounce. Inside the Lightmass properties, there is a property called Indirect Normal Influence Boost. The default there is 0.3 I believe and if you set that to 0.0 you should get cleaner results. This will have impact even without using any normal maps and it can worsen when you have normal maps.

                Your problem here seems very extreme and I won't be 100% sure that, that is the only problem.

                Smoothing groups will have an impact here as well. Make sure it's clean so your 90 degree corners and things like that, are clean. This will ensure less stray photons from the light bouncing, just like the normal influence setting will do as well.

                It's sort of impossible to tell from just a shot, if lightmap specular has any influence here. That's also a cause for bad looking ambient areas. Although you can tell if that's the problem if it's shading that looks bad and changes when you move around. You can switch this off in your material under the Misc properties, Allow Lightmap Specular.

                I may have another theory but I'd like to know the results of these changes first, if you test them.

                Comment


                  #9
                  Unfortunately, these settings seem to be no variables in the problem.
                  For ease I removed all smoothing groups, set Indirect Normal Influence from 0.3 to 0.0, and unchecked 'Allow Lightmap Specular' for the material.
                  Then I rebuilt the lighting.
                  The results summarizes the above (front/back/settings):
                  http://imageshack.us/a/img838/3171/xedl.png

                  Comment


                    #10
                    Ok, so my last theory is about scale. I know that the scale of the model can have negative impact on the lighting. Whether too big or too small and depending on the model itself. Its got to do with the photon distribution. In, short, there's not enough photons there, as you can see on your model, those big circle shapes in the lighting, that's the individual photons. This is not related to light map resolution.

                    The part that is what I think cause the problem is the fact that you have a big model with small pieces with harsh angles. Like, the pillar next to the wall. If the model is big but a simple shape, it shouldn't be a problem, but with those harsh angles on there, the photons scatter and there's not enough to cover that.

                    So what you can try is detach the details from the main boxy pieces. If you notice any difference but it's not good enough then break it up even further. What I might do in this situation is have two pillars as one mesh, have one of those bottom parts as one mesh, have the main arch piece as one mesh and have the top piece as one mesh. Then you can piece it together out of those smaller pieces.

                    Also, of course if you're building on Preview, all these problems are much worse.

                    So, if this does not give you any better results, I'd like to get hold of that model and see for myself directly what's going on, if that's possible.

                    Comment


                      #11
                      On which quality level are you building your lightmaps? Unfortunately, there can be quite dramatic difference between Preview and Production..

                      Comment


                        #12
                        http://imageshack.us/a/img593/470/a1k.png
                        Image: Splitted my model up in logical chunks: pillars, capitals, feet, archpart, all the different cornices where seperated. Tried both preview and production lighting. Doesn't seem to effect the lighting, although production lighting makes the spots a little bit smaller.

                        Edit: anyone that wants to examine the models please PM me.

                        Comment


                          #13
                          I was able to get some cleaner results and the theory about breaking up the model seems to be the one here that makes ultimately the real difference. I still don't know why you can get cleaner bounces with broken up pieces, even if they ultimately occupy the same space. But anyway, it does work.. so.. yeah.

                          This just shows how I ended up breaking it up.



                          I also tested with only two pieces, with 2 and 3 being one piece, but that cause some problems on the pillars. You can try that and see if it's acceptable or not. Also, I got rid of ambient occlusion in the lightmass. It actually just looks better without it. AO has it's place but I think here it's causing more problems than you'd want. You can simply tweak the settings so it's less extreme but I think ultimately, getting rid of it was a good result.

                          Also, just to mention I did make sure to have clean smoothing groups, that is definitely something you need if you don't use normal maps to force shading in some way.

                          Otherwise, I did no extra tweaks. You can still switch the normal influence to 0.0. That will benefit you down the road if you make lots of use of normal maps.

                          Also then, light map resolution. With your current model and UV layout, the 512 makes sense. But if you break it apart, you can rearrange the UV's on channel 2 and get away probably with 256 res. This means you'll have either two or three, depending on what pieces you break into, and that is actually still less memory used than one 512 map but with basically same quality.

                          And also just to mention, draw calls. You will have more draw calls but still a minor thing in this case. Unless you used say 100 of these in one group which wold in fact turn to 200 or 300, this will not be a problem. In fact, typically you'd have levels use more pieces to build up a structure like that so it's probably a non issue.

                          And, so here's my result. I think it's acceptable but.. you be the judge. Pushing up light map res can certainly tighten things up more in the corners, but that is your call ,tweak that as you see fit.

                          Attached Files

                          Comment


                            #14
                            Hi, thank you for helping me - it looks great!
                            However before I conclude I would like to see the model myself now as my own attempt at doing the things you did, did not work out quite as good.

                            I triangulated, made the same pieces, largened the UV maps and disabled the ambient occlusion.
                            Smoothing groups remain a very vague thing in Blender.
                            The result holds up like this:

                            Reflection seems a bit orangy at parts and the most clear difference with your model is seen at the feet.

                            Comment


                              #15
                              Yeah, I'm not sure. I can only guess your diffuse boost is maybe very high?. That's what would cause more pronounced bounced light. I always put that on 1.0 otherwise you get a glowy kind of look. I am sure the UDK default map is also set to 1 though.

                              I don't know if you have a test map saved out where you already made changes and are testing from, but maybe start from scratch on the UDK default map, then go and just disable AO in there and test your model.

                              The lighting seems clean on your shot, you're just getting a very heavy bounce from the sun and I can only guess that is diffuse boost setting causing it. otherwise, I'm not so sure.

                              Comment

                              Working...
                              X