Student Project, Problems with lighting

**EDIT: Please There is an update in the last page :smiley:
Hello everyone!!

I’m a student of a 3D Games Design postgraduate course and for the final assertment of one subject I’m doing this project.

The project itself its a part of a cathedral , with some basic props. The textures that you can see in the screenshots are just placeholders.

I’m really stuck with the illumination because I can’t achieve what I want and I have tried like 10 times to re-do the lighting…

First of all I would like to show you some references (all made in UDK or UE4) that have the lighting level that I would love to achieve.



Well the ilumination of this project is simply amazing. I really like the illumination from the side that you can see the godrays

  • UDK Project (cant remember exactly where i got the refs)

Although this illumination is simplier and darker at the lower part of the scene, the global illumination is really nice and you can see everything clear

I would really like to do the illumination like those projects but I’m really finding problems with it and I’m starting to be desperate…
The small lights like candle lights or lamp lights are not a problem but the main light source is the one I cant do…

And here it is my problem:

  • First of all , unlit mode so you can see the props and everything looks fine (some textures as placeholders)

  • Material of the stained glasses and the other windows have the same type of material.

  • Regular material of a wall and a bench.

  • This project is the one I did a lot of test but now it only has one directional light that I just added with those parameters and look the results… :frowning:

As you can see, weird shadows and light parts in the geometry, weird shadow differences and well… you can see it…
There are NO GAPS between geometry, some of them I had to overlap them a little bit.

I want to try it in a new project but I dont really have time to again put the asset 1 by one and do the layout again.

Thank you very much and I would really appreciate your help because I’m running out of ideas…

I think you’ve got some objects that are one-sided that aren’t blocking light—there’s an option if you select the object so that it will block light on the backfaces
Also, your lightmap resolution looks to be very low on your objects, and you may have lightmap UV’s issues. And for long flat walls/floors/ceilings you need to try and use as few objects as possible, because you can end up with seams due to lightmaps because each object gets processed individually for lighting and the lightmaps don’t get smoothed across meshes.

New version, created a new project and started almost everything from scratch (the objects I copied and placed them from v2 to v3)

Instead of a custom skydome, I used gregdumb’s one.
Still getting really weird lights and shadows… :frowning:

As you can see here, there are some parts of the mesh that are “lighter” and they are supposed to be dark… You can see those parts at the bottom-right part of the image…

In the following picture you can see those parts better and also that “bloom” that is just… weird.

Position of the sun:

The mesh have no gaps:

I will show you an example of one of the windows, how the mesh is and how is imported:

As you can see in the pictures, yes the backfaces are deleted (for better performance) and the lightmap resolution is usually 64 (all but the floors that have way bigger resolutions)

The floors are just 3 big planes and the other walls are more because of modularity.

I’m not really sure what option are you talking about :S I checked “Two Sided” on every material.

Thank you

your lightmap resolution is way too low for something with that much detail, you can really only get away with a low lightmap resolution with really flat objects that can use the UV space more efficiently without as much gaps.
Also, you may have to model the outer walls of the building to block light from bleeding in.

There’s also some optimization that you can do, some vertices you can weld together from the arches, remember in a game everything is going to be triangles anyways, you can use lots of triangles as long as it looks fine so I would weld the edges from the arches to the corners of those shapes. Also, you want to have as few separations between objects as possible and as few seams in the lightmap UV’s as possible.

I will increase the lightmap resolution of every object and see the result!!

I have another object in the same UV space so thats why there are big gaps there.

I will model some outer walls but I can’t really make everything with outer walls as I have windows and those walls will block the windows…
I would take those optimization advices for my next project because I can’t really remake all the assets in this shor ammount of time :frowning:

I still cant understand why I cant do that thing, not having those back faces… Those seem to be the problem of all my illumination but I did some research in one of the example projects and it use the same method as me…

1- Everything looks fine here

2- If we see the back, we can see that some parts are planes, they dont have thikness but still the shadows are correct.

3- The mesh also shows that parts as planes

4- The highlighted part of the mesh is actually the geometry that is a plane

5- The back view of that highlighted part of the mesh

I think the main problem here is that my models don’t block the light propertly :S

Thanks again

Yeah, blocking light can be an issue, also, if there’s any surface that extends outside of the wall and goes inside, it can receive illumination from the sun outside and can bleed inside on the texture

dayum… Im doing some test with bsps acting as outer walls where there are no windows to see how it works…
The only thing I can do if that doesnt work is open every model that has back faces deleted and make them, overlap those new faces in the uv channel (or even dont map them because I just need the geometry) and reimport…

I dont really like that solution because for me that means that I cant use models without back faces in unreal engine 4 and also my polycount will increase a lot…

Do you know if I have selected that option to block the light on backfaces?

Thank you!!

Result of those tests:

It seems now that with some bsps I can block the light from the most problematic parts but I still have some objects that are shaded so different (some of them are darker than another ones and they are close to eachother, 3rd picture)

Also I’m thinking about those selected windows just make some adjustments. I think I do have quite a lot of windows there.

Go to the world properties and under the Lightmass section lower the smoothing, it will try to make the lightmap cleaner by smoothing samples together, but it can create seams between meshes, you may have to increase the lightmass quality.
To make sure that objects are casting shadows as two-sided, go to the lighting section in the mesh properties, there’s a checkbox for Cast Shadow as Two Sided, it will take longer to render, but may be necessary.
If you want to model the back faces, then you can change your lightmap UV’s so that the back side is smaller so that you don’t waste lightmap space on there, just so that it more accurately blocks the light.
There can also be an improvement if you render with Production quality, and if you increase the number of lightmass bounces, default is 3.

Thanks, right now Im doing a build with production quality, bounces at 4, lowered the smooth to 0.8 and checked that option. It will take an hour or so to render in production because in preview it takes like 10 mins in this laptop (despite being an i7, 8gb ram. The graphic card its AMD Radeon HD 6750M. Its a MBP late 2011)

The only thing I don’t know exactly how to do it is changing the lightmap UV’s but if I go for the modelling option I’ll see then :smiley:


I’ve made all of the changes but still the same issues…
Even I made a second channel for the lightmap uvs for most of the objects but I didn’t notice any change at all.

I’ve highlighted the important things in the following screenshots:

PD: I’ve also tryied to increase the lightmap resolution but the highlighted things are the same…


That’s not the right settings, there’s an option for Lightmap Coordinate Index, which configures which UV channel to use for lightmaps, you need to make sure that setting is set to the right UV channel. Those settings are for how it generates lightmap UV’s in the editor, which is an option. However, it would be best to do them yourself in your 3D program before exporting to UE4 since you can do a better job than the engine can, you want as few seams as possible.

Also, 64 is not enough resolution for something like that, remember that’s 64x64 pixels and you’ve got some really small parts. The space between lightmaps is an issue as well, if there’s not enough space then there’s bleeding.

Increased resolution and checked the right option for the coordinate (yeah I did the uvs in 3ds Max)
Increased the resolution, the window is set to 1024 and the walls 512 (the lightmap uvs are maybe a little bit small for the walls, but the vertical wall had 1024 of resolution and as its shown in the image, its dark…)

Also I checked the light density and I can see that the windows are in red, but I’m not sure how can I fix that.

PD: Is there any way to “disable” the lightmap thing just to test it out?? I’m starting to be scared that this issue is that bad and even without doind texturing… :frowning:

Thank you very much again

Ive uploaded the project (without the saved folder, so maybe a build is required) in case you can see any option that is disable or what may cause the problem :S

Thank you and sorry for the massive questions hehe

So I’ve looked over it and there’s a number of issues, main stuff is modeling and UV mapping.

-stuff needs to be welded together, you’ve got something like an arch that’s got sides to it next to another arch where the two pieces should be welded together.
-delete surfaces that aren’t ever going to be seen or contribute to lighting, like on the stairs there’s a back and another side that’s not needed
-high poly count, there’s edges that aren’t needed, like on arches you can connect the arch vertices to the corners.
-panels don’t line up, the vertices need to exactly line up together when you’re positioning wall sections, they can’t overlap or have gaps
-ceiling needs to match the actual ceiling space exactly, you’ve got some planes that are just placed over the top and they go past the walls, they need to line up exactly
-UV mapping for lightmaps needs to be done better, reduce the number of seams in the UV maps, the less the number of seams the better lightmaps you get.
-reduce the number of objects making up a wall, you’ve got it built in sections which an be good in some cases so that things are reconfigurable, but if the parts are pretty simple and you would get better results if it is made of less individual meshes. Lighting gets rendered on each object individually and you can end up with seams if you have a lot of separated pieces.

I’ve attached an example of correct modeling and UV mapping


Thank you really much for the time looking through my project and check of the 3D models and stuff.

I am going to re-model everything that I can see that I can improve (like all of the arches) and re-map also.

I’m going to adjust everything and that way I wont have to overlap anything.

I will have all of this done before 1st of January

Lets see if with this changes I get a better illumination.


Something people can’t seem to get their head around is using Lightmass as a BASIC GI solution, where a few pixels can fill a large space on a basic mesh. By putting components that will always be dark (bottom faces of columns, if they exist, ledges of windows, etc) right next to components that always receive light (top of ledges, wall facing light, etc.), there will be horrendous pixel bleeding. If you need shadows, use dynamic cascaded shadows: they will always be sharp, and require no baking. The shaders can take care of the bulk of the heavy rendering, and lightmass just fills in the appropriate shade and color for different models.

There’s no need to remodel anything. If there’s a lighting problem, chances are it’s because the lightmap is not appropriate, not any deficiency with the model. I had a school project where I had to keep within a small budget of polygons, and I had a model of a tablecloth. I deleted all the faces on the table and replaced it with a giant quad: then, I butted up all the edges against the polygon. As it turned out, some of the vertecies weren’t aligned completely perfectly, but the lighting was still good because I knew lightmass would wash over the tabletop as a single whole.

Also, I noticed your source lightmap index is set to the wrong UV channel on the two models that are giving you problems. And one of your models has a tiny square on a large UV sheet for the lightmap: all those empty pixels will be wasted completely. Try a build just fixing that, and if the problem is still bad (or you just would much rather lower your lightmap resolution), then you can follow my methodology.

That’s not what lightmass does, lightmass gives you high quality lighting where it calculates light bounces which takes too long to do in real-time. Using lightmass, the static objects will get that high quality GI, and anything dynamic will use dynamic shadows. If you don’t use lightmass then you can only have dynamic shadows which aren’t going to look as good. It’s a big problem for interior maps where a lot of illumination comes from bounce lighting. Light coming in from a window can illuminate the entire room, but that doesn’t happen with dynamic lighting.

It can be both, in his case he has intersecting meshes and parts that don’t line up, that will cause problems no matter what the lightmap is like. And with lightmass you have to be careful how things are split up because of how you can get seams.

I know lightmass is supposed to do that, but in my experience, especially when concerning complex models with bevels, insets, and multiple pieces, the end result can’t possibly be rendered perfectly with lighting and shadows from lightmass alone. It really doesn’t handle complex bounces at all: everything from lightmass bounces at a medium roughness: caustics are impossible to render. I’m surprised it handles translucent lighting, though. Also, lightmass is terrible to rely on in konedj’s case because the scene relies so much on bounce light that it’s basically mixing together and lighting the entire scene with a very soft generic light. A skylight would be useful for this purpose, where lightmass fails. And I’d increase the number of bounces in lightmass too.