Announcement

Collapse
No announcement yet.

Help with bizarre lightmap results. Pics included

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

    Help with bizarre lightmap results. Pics included

    Hello,

    I'm having issues with lightmaping results. So I have a spaceship hall with a large window that lets in light (a directional light in this case). Dynamically it mostly works. The large window and it's sort of messy frames create shadows correctly on the room itself. The side walls are darker than they used to though.

    http://imgur.com/SpwfBJR

    But after a lightmap one of two things happens. Either it goes pitch black apart from some lit parts on the frames at the left or I get a bizarre shape that has the shadows cast by the window frames go in strange directions. I say one of two since this is dependant on the lightmap index in the mesh editor I think. I tried 0 and 1.

    http://imgur.com/RmTkV8e

    I should note my lightmap worked fine before. I got the result from pic 1 but obviously a softer lightmap verson. The project though was made in a slightly earlier Unreal version and the .fbx of the model done in a slightly earlier version of blender. So what happened was I made a new copy of the project for the newer Unreal and the model looked good. But I hadn't redone the lightmap yet. I made a small adjustment of the model in blender 2.8 and exported it to the project and did a lightmap and now here I am. Also I kept the old .fbx and when I put it back into the place of the slightly changed one I still don't get the nice lightmap I used too.

    Hope this makes sense.

    #2
    The LM index of 0 is for texture maps, by default, according to what I read. And it is, from what I've seen by opening existing meshes (such as from Starter Content or a template level) in the mesh editor and displaying the UV layout for channel 0. Index 1 or 2 are used for lightmaps, then. If a lightmap is generated from channel 0, and placed in channel 1 (via Destination LM Index setting in the mesh editor), then it could be rendered wrong, somehow having retained texture map data and put that in the lightmap (such as overlapping UVs, and wrapping UVs). That may result in the shadows having wrong direction / positioning, and probably amount / intensity too. If that's what the problem is, I suggest trying to generate a lightmap for the old .fbx in the mesh editor after re-importing it. In other words, re-import the old .fbx without enabling "Generate Lightmap UVs" and keeping the normals from Blender (Import Normals). Then in the UE mesh editor, before generating a lightmap for the mesh, select channel 1 for Source Index and Channel 1 for Destination Index. Do not make any other changes in the mesh editor Build or General settings, and generate the lightmap from the above tool used to view UVs and Unwrap. I had a similar issue when importing a mesh from Blender, which is a spherical character that's a sort of robot (not a character mesh though with rigging and all that), where it was black or mostly black upon import and adding it to the scene. I had to try different ways of importing and different settings for normals to get it to display properly and so it wasn't also pixelated while maintaining the reflectivity it had in Blender.

    So, the steps I suggest are:

    1. Re-import the old .fbx file, and disable the 'generate lightmap uvs' option in the import dialog
    2. Set it to Import Normals
    3. Set Source and Destination Index in the mesh editor for it to Channel 1
    4. Don't change settings for the first go at it
    5. Generate Lightmap UVs

    Comment


      #3
      Looks like you have overlapping UV islands in your lightmap

      Comment


        #4
        Originally posted by presto423 View Post
        The LM index of 0 is for texture maps, by default, according to what I read. And it is, from what I've seen by opening existing meshes (such as from Starter Content or a template level) in the mesh editor and displaying the UV layout for channel 0. Index 1 or 2 are used for lightmaps, then. If a lightmap is generated from channel 0, and placed in channel 1 (via Destination LM Index setting in the mesh editor), then it could be rendered wrong, somehow having retained texture map data and put that in the lightmap (such as overlapping UVs, and wrapping UVs). That may result in the shadows having wrong direction / positioning, and probably amount / intensity too. If that's what the problem is, I suggest trying to generate a lightmap for the old .fbx in the mesh editor after re-importing it. In other words, re-import the old .fbx without enabling "Generate Lightmap UVs" and keeping the normals from Blender (Import Normals). Then in the UE mesh editor, before generating a lightmap for the mesh, select channel 1 for Source Index and Channel 1 for Destination Index. Do not make any other changes in the mesh editor Build or General settings, and generate the lightmap from the above tool used to view UVs and Unwrap. I had a similar issue when importing a mesh from Blender, which is a spherical character that's a sort of robot (not a character mesh though with rigging and all that), where it was black or mostly black upon import and adding it to the scene. I had to try different ways of importing and different settings for normals to get it to display properly and so it wasn't also pixelated while maintaining the reflectivity it had in Blender.

        So, the steps I suggest are:

        1. Re-import the old .fbx file, and disable the 'generate lightmap uvs' option in the import dialog
        2. Set it to Import Normals
        3. Set Source and Destination Index in the mesh editor for it to Channel 1
        4. Don't change settings for the first go at it
        5. Generate Lightmap UVs
        Originally posted by Arkiras View Post
        Looks like you have overlapping UV islands in your lightmap
        Thanks for the help. I will look into this.

        Comment

        Working...
        X