x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Serious Lighting Problems In UE4

Hello, I have been trying for over a week now in UE4 just to create a simple wall, no matter what I do or what tutorials I watch my static mesh is always left with shadow problem like these:

If you look at this image you will notice the two static mesh walls create a tiled lighting effect. Image1

Also if you look at this image the lightmap is projecting black lines on my mesh. Image2

If it isn't dark shadows in the corner of my walls it's those black lines every time. I have changed the lightmap arrangement many times.

The black lines issue is solved when I up the shadow resolution to 256 however I am worried this will cause performance issues as my level will be quite demanding.

I noticed the walls supplied in UE4 worked perfectly so I exported them and gave them materials in blender to have multicoloured walls however when I imported the mesh back into UE4 there was a huge shadow in the corner.

Before anybody asks I have been rebuilding the lighting...

Here are some of the static meshes I have made:

This is one I have made from scratch http://www.mediafire.com/view/2p6vrzb8yzpv955/Wall4Mx30CMx4M.fbx This is the exported wall from UE4 that I added materials onto http://www.mediafire.com/view/fnq2snihbbmd1bq/wall400x20x400final.fbx

Any help would be great thanks :)

Product Version: Not Selected
Tags:
more ▼

asked Jun 16 '14 at 03:22 PM in Rendering

avatar image

Nickmadd
22 10 14 17

avatar image Nickmadd Jun 16 '14 at 06:06 PM

Thanks that does make quite a lot of sense actually, I don't know why I chose to build it like that. Is it okay to merge static mesh in UE4 for example where two walls meet is it okay to merge them inside eachother or is that bad practice? Also I have tried all of the above to remove the shadows on my objects but get the same result. If you take a look at this:

Lightmap

All of the lightmap UV islands are spread apart. (That is the wall I exported from UE4)

Thanks :)

lightmap.png (180.8 kB)
avatar image RyanB STAFF Jun 16 '14 at 06:11 PM

Ok I see the problem right away. You simply don't have nearly enough space between those charts. Think of it this way: I cropped your UV area in photoshop, its around 400x400 pixels in the image. You only appear to have around 2 pixels (at this scale) between the charts. Above, you mentioned that at 256 resolution the seam gets lessened. This makes perfect sense, because 256 is a bit more than half of 400. So at 256, you have barely over 1 pixel between the charts! at 128 it would be half that, and at 64 they basically share pixels.

If you want to have no seams on a 64x64 lightmap, you need to have an entire 1/64 of the entire UV size between each chart.

By that math, you should have 6.25 pixels between each chart in that 400x400 pixel preview. That means you need roughly 3 to 4 times the space between those charts to have a good looking 64x64 lightmap. It's all simple math.

avatar image Nickmadd Jun 16 '14 at 07:01 PM

Thanks I got a G in Math so let's so it isn't one of my strengths haha :) Thanks for the help I understand the issue now. Would you recommend I change the UV size or is that not possible? I'm still a noob at this point so if I can change the UV size does that mean it would be more performance hungry? Thanks

avatar image RyanB STAFF Jun 16 '14 at 07:03 PM

Increasing the lightmap resolution is more the 'quick and dirty' fix. It won't affect performance of rendering much if at all, but it will dramatically increase the lighting rebuild times. If the scene is large and complex, eventually you may get texture memory problems from huge lightmaps too.

avatar image Nickmadd Jun 17 '14 at 12:02 PM

Okay so I have started to build my map with large pieces instead, what I have now noticed are the textures are huge and stretched now that I have made larger objects. Here is an example:

Stretched

If you look at the image you will notice towards the arch the texture becomes very stretched but doesn't happen anywhere else for some reason. Although the rest of the wall has massive textures it doesn't have that stretch that you see next to the arch on both sides.

The shadows works perfectly now though it's just this issue now.

Here is the model and wire frame:

Wireframe

I am aware the UV is quite messed up although because it's such a large object I don't know how to unwrap large objects.

Any ideas what I can do?

Thanks :)

hey.jpg (451.5 kB)
largewall.png (156.8 kB)
avatar image RyanB STAFF Jun 17 '14 at 03:42 PM

It looks like you are using the same UV set for texturing and lightmaps. Normally, the 1st UV channel would be very tiled in this case, meaning it would extend well beyond the 0-1 range that your UVs are compressed into It can also overlap as much as you want. Your lightmap UV channel on the other hand you want to be laid out non-overlapping and all inside the 0-1 range.

I haven't used blender so I am not sure how you could make those UVs there. In 3dsmax I would simply do a UVW mapping modifier set to box mapping, and tweak the scale until the bricks looked like the right size.

Once you import into the editor, you need to open the static mesh properties and specify which UV channel to use in the LightmapCoordinateIndex setting.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi, I am guessing it is because you are not giving an empty buffer zone around each UV chart in the lightmap UVs. How are you generating lightmap UVs? it is possible that the UE4 wall you tried to re-export and re-import lost either its lightmap UVs or the lightmapcoordinateindex setting after reimporting, so you weren't seeing the same asset in the same configuration.

Also, your first image looks more like lighting was not rebuilt using Production quality. I believe there also is a bug with different lightmass threads causing some of those seams, but that is a different artifact from the corner seams. Going to Production should still help reduce it. If not, do you really need the wall to be individual meshes next to eachother? I would never build a level like that, it would get pretty expensive. I'd make a longer wall section that was merged together with one nice clean lightmap surface.

I do not have a mediafire account but if you are unable to figure this out after my advice I will sign up and check out the file.

more ▼

answered Jun 16 '14 at 05:30 PM

avatar image

RyanB STAFF
2.1k 56 24 118

avatar image Nickmadd Jun 16 '14 at 06:06 PM

Thanks that does make quite a lot of sense actually, I don't know why I chose to build it like that. Is it okay to merge static mesh in UE4 for example where two walls meet is it okay to merge them inside eachother or is that bad practice? Also I have tried all of the above to remove the shadows on my objects but get the same result. If you take a look at this:

Lightmap

All of the lightmap UV islands are spread apart. (That is the wall I exported from UE4)

Thanks :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question