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"

Blender Lightmap Problems

Hello,I am trying to make meshes in blender and import them to ue4,and some of them end up with weird shadow bleed,I am kinda new to modeling so i probably done something wrong,the thing is,that i saw many videos\posts on this subject and i yet to find a proper answer for my problem,its even harder when most of the detailed tutorials are for Maya,and although i saw them,didn't help me as much as i thought.

Anyway,here are the pictures of the mesh inside Ue4(before and after build): alt text alt text

and in blender (two objects with two different lightmaps and uvs,i tried combining them,but it yields bad results): alt text alt text

Thanks in advance.

Product Version: UE 4.10
ue4treeafter.png (1.8 MB)
lm1.png (408.2 kB)
lm2.png (411.1 kB)
more ▼

asked Feb 17 '16 at 12:19 PM in Rendering

avatar image

8 2 3 4

avatar image 5v29n Feb 18 '16 at 11:01 AM

Did you check the normals inside blender ? (In Editmode: Ctrl + N / Shift + Ctrl + N)

avatar image SliverStep Feb 18 '16 at 11:12 AM

Tried it now,sadly it didn't help >_<

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

3 answers: sort voted first

you have way too many uv islands, which wastes most of your texture data on padding, and creates islands thinner than a pixel in lightmap resolution.

break the object down into cylinders and spheres, unwrap each cylinder with a single UV island, and unwrap each sphere with 2 islands, splitting the sphere into top and bottom halfs.

more ▼

answered Feb 17 '16 at 06:20 PM

avatar image

9.6k 320 205 450

avatar image SliverStep Feb 18 '16 at 10:44 AM

its kinda hard for me to understand,you mean that i should separate parts of the mesh into objects(branches from bark and so on) in the shapes that you described?

and by unwrapping with single islands,do you mean marking seams and manually unwrapping?

i am still getting the hang of blender so its kinda hard for me >_<

avatar image ScottSpadea Feb 18 '16 at 12:49 PM

you don't have to physically separate the meshes or split them into separate objects, i meant you should treat each of those parts as separate uv islands.

blender's lightmap pack will break every face into individual islands, which means each face will need to waste extra space on padding.

instead of lightmap pack, try using smart uv project with an angle between 60 and 80, with island margin of 1. if that still doesn't give great results, mark edges with seams and manually unwrap, so that you can make better use of the texture space.

if you are still getting problems after all of that, increase the padding between islands, or increase the lightmap resolution of the mesh in ue4.

but if you did want to break the model into separate meshes, it might help you create more variety. with separate meshes for a trunk, a branch, and a sphere, you could make a blueprint with a construction script that uses random numbers to add variation to the orientation and scale of spawned instanceStaticMeshes. basically, you would be making a simple version of speed tree in ue4.

or, if you wanted to skip the coding part, you could just place those tree parts in the level, and when you build a tree you want to reuse, you can convert those meshes into a blueprint, which you can reuse anywhere.

avatar image SliverStep Feb 18 '16 at 02:22 PM

using this method really reduces the amount of bleed,though there still is a small amount of bleed, i did "smart uv project" as you said,and then i packed islands.

I tried to mark seams and do a normal unpacking,but it didn't yield good results,i probably didn't mark them properly,ill just try it differently now.

This is the result: alt text

for some reason the shadow itself is still twisted,and i have no idea why,it happens with different meshes too (even the engine defaults ones).

i really liked the idea that you can create a verity of trees with multiple meshes,i think i will try it too,and i will try to create uvs as you said, im starting to understand the uv packing much better with your information!

bt1.png (1.2 MB)
avatar image ScottSpadea Feb 18 '16 at 02:36 PM

if there is still a small amount of bleed, and its visible from your in game view, you can increase the uv padding in blender, by using PackIslands with a larger margin.

the twisted bumpy shadows on the floor is a different problem, caused by the lightmap resolution of the floor mesh. if you increase the lightmap resolution of the floor, it should solve that problem. lightmap resolution affects how well an object receives shadows, but doesn't affect how an object casts shadows. each of those bumps in the floor shadow is actually the size of a single pixel in the lightmap of that floor mesh.

avatar image SliverStep Feb 18 '16 at 03:39 PM

Wow! thanks a ton! the mesh looks much better now! Not only you solved my problem,you taught me new things! Thanks for the help!

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

The after image didnt open for me. But probably the problem is that the shadow information in the lightmap bleeds out to other faces. That happens when the gap between the uv islands is too small.

You have 2 solutions: - Increase the gap betweern the uv islands in your uv. Then reimport that mesh in unreal and use that uv for lightmap calculations (dont let unreal create a lightmap uv at import) - Increase the lightmap resolution. This one should be used with caution because it affects performance.

You can use a combination of the two methods, until you get a good result.

But, as i have some experience with that, you may get some shadow bleed from time to time. When you get all the scene together, with normal maps and occlusion, its hard to notice the shadow bleed .

more ▼

answered Feb 17 '16 at 12:40 PM

avatar image

48 4 6 10

avatar image SliverStep Feb 17 '16 at 01:06 PM

I already tried that,but the problem persists. ill upload the picture agian: alt text

i also forgot to mention that the shadow itself becomes twisted,and not only the mesh itself.

ue4treeafter.png (1.8 MB)
avatar image schmigel Feb 17 '16 at 01:55 PM

Seeing the image looks like a bleed problem. I got this problem one time and increasing the lightmap resolution solved. Did you try increasing the lightmap to a very high valeu just to see if something changes?

I can see in your uv all faces are separated as islands.. You should try to merge some islands. Like the main branch of the tree. Theres no reason to have 1 uv island for each face.

I would say that maybe the normals of some faces are twisted... When the face are full dark..

Besides the lightmap and uv issue, I dont know what that could be...

avatar image SliverStep Feb 18 '16 at 10:55 AM

setting the resolution to a very high value did make the bleed disappear,though the shadow itself still looks twisted,and its probably wont be performance wise to use the resolution in that amount. ill try to decrease the amount of islands.

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

Reducing your uv island might do the trick. Like Scott told.

more ▼

answered Feb 18 '16 at 01:34 PM

avatar image

48 4 6 10

(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