Student Project, Problems with lighting

That’s entirely what lightmass is supposed to do, and when you construct things properly it can do that. Lightmass can do complex bouncing just fine, that’s what it’s supposed to do. The main issue is that it saves to texture maps, which can be difficult to look right. Not many things need caustics so it’s not even a problem. Lightmass is perfect for this situation because getting good bounce lighting is what it’s for, Skylights won’t do that. It just takes understanding of the system to be able to get good results, just like anything.

Darthviper I have a little question.

In the model that you fixed, I can see in the screenshot that you did a cap on the windows (The windows I wil basically do like a translucent shader). Right now I used simple planes to save polygons.

Is it correct that I still use planes for that or I need to cap the polygons as you did in the screenshot. Also if I cap them, should I leave them like that?? Because its going to be a face with more than 4 vertices :S

Thanks

Yeah, I saw you put just a plane over each window, I think it’s best that you have the cap so that it’s exactly in place, otherwise the shadows from the glass might not line up correctly on the rest of the mesh. It’s OK that it’s not a quad, it will get triangulated when it’s imported to UE4. Quads only matter for sculpting, because they give predictable results when subdivided, with games everything gets triangulated so it doesn’t matter as long as it looks good.

Great :smiley:

Basically today I started fixing everything.

I had some problems with meshes that they weren’t lining up propertly. Now it does it so I wont have to overlap anything of the walls. Also I did again the door model and change almos all the uv maps (also lighmap uvs)

I’m going by sections, I’ll say that the first section is already fixed:

I still need to change the planes (glasses)

  1. Assets from the first section, modified the geometry to decrease polycount


2. Back part of the assets, still need use the capped geometry instead of the planes (it will increase the polycount though)


3. Before the UV maps were mixed (like one window with some stairs). Now I’m trying to do better UV maps (with lightmap uvs in the second channel) and dont mix props with walls/windows

Channel 1


Channel 2


4. New door, I still need to make the high poly version but this is already mapped and I could save some geometry welding vertex but I think just this time its ok


5. Now this section is looking better, everything snaps perfectly.


I will do the other 2 sections in 24 hours

Thanks!! :slight_smile:

That looks much better–also forgot to mention, but a number of meshes didn’t have smoothing applied, you can just apply a Smooth modifier and adjust the smoothing angle to get that correct. That way curved surfaces don’t have facets.

The UV shells in your lightmap UVs are too close together. Once compressed, you’ll need 4 pixels of space between each UV island to prevent bleeding completely. This results in very small shells and inaccurate bounce, but the results are clean. If you plan on using a 64 or 128 lightmap (considering the size, 128 shouldn’t be TOO dense), then make sure you have 4 pixels space between each piece. I’m not familiar with 3DS Max, but Maya has the option to rearrange UV shells for a lightmap size. I’m certain you can have pieces touching the edge of the UV sheet because it will get compressed anyways, so I always choose a size down to get larger shells and then move the pieces to account for the pixel size.

Here’s another caveat to lightmass: the calculation just multiplies against the color. So if your base color is a .5 shade of gray, after three bounces, the light becomes very difficult to see. Light does not travel for too many bounces. Don’t try to fit a round peg into a square hole: use a skylight, fill the environment with a basic color, and use post-process AO to darken corner edges. Then, work with lightmaps appropriately, and you will be pleased with the result. Trust me as a student who wasted ridiculous lightmass settings (100 bounces, 256 pixel lightmaps, etc.) and good lightmap UV practices trying to emulate high-quality CGI: it’s not going to work that way. Lightmass does not handle complex specular reflections. You can’t light a car and then get the shape of the caustic bounce off of it. You can’t shine a light over a mirror and get a perfect reflection. Don’t try to make lightmass take care of more than it’s good for.

As for the window panes, it’s fine to leave them square as-is. Nobody’s going to see that, and lightmass doesn’t need to calculate shadows for it as a solid object. Use an unlit modulated material with separate translucency unchecked and two-sided checked: the colors will blend naturally with lightmass into your scene, and because it’s unlit, it won’t create any shadows. This is the one thing lightmass is exceptionally good for: take advantage of it! The colors in your scene will be outstanding with the stained glass effect applied appropriately!

Thanks guys

I’ll separate a little bit the uvs from eachother.

Right now the textures are just placeholders and with the new uv maps I’ll have to texture them again. The lighting thing is too complicate haha.

Right now I’m using just the directional light in Movable mode but this way the stained glass materials doesn’t work propertly because the directional ligh has to be in static mode… But I don’t like the results with the light in static mode.

Here are some pics:

  1. Directional light is MOVABLE


2. Directional light is STATIC


3. With the directional light set as static, the colors are just great (they are beater increasing the lightmap resolution of the floor but for this builds I dont have a high resolution on them


4. This is the material of the stained glasses (its the same for the other windows)


To make the material work on movable lights I will have to fake the colored shadows using 3 light functions (I saw it here: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums)

Alright!! All sections finished.

I had to use couple walls as helpers but its okey because with those I will do some variations of the textures.

Now I’m going to finish uv mapping everything because I changed a lot of the meshes, added more detail in some and also now the uv sets are grouped by types (before one uv set was Bench & SadWindow and other one Railing & Stained Window. Now is SadWindow & Stained Window and so). This way I can for example make 4096x4096 texutres for the windows and walls and 2048x2048 for the props.

I think now it looks so much cleaner and I’m feeling good about fixing everything :D. Lets see tomorrow when I import everything in UE4 if the lighting works better.
Also I forgot to mention that I think I decreased the polycount by half with this changes…


PD: As soon as the lighting its fixed I should ask to move the thread to the “Work In Progress” section haha

Thanks

Light travels for many many bounces, it just loses some energy each time. There’s almost no reason to have reflective caustics, very few people use them even with photorealistic movie FX because you hardly notice it, unless you are specifically bringing attention to something reflecting light like that. And it wouldn’t matter for his situation, he just needs to get good interior lighting, which is what lightmass is for.

In the real world, light scatters different ways depending on the “roughness” of the material. “Caustics” is just the phenomenon of light bouncing on a shiny surface. But Lightmass doesn’t distinguish between blurred bounce surfaces like carpet and sharp bounce surfaces like marble floors. That distinguishing factor really could’ve helped a church setting where marble floors and nicely finished wooden surfaces meet rough columns and medium wall surfaces. There are caustics all over the place in church settings: it’s just very difficult to compute.

Ideally, light using the lightmass model would be somewhat accurate in value if there were unlimited bounces, but there are not. As the bounces increase, light becomes softer and softer and softer, but after a few bounces light does not get soft enough to fill in dark areas. Many locations using lightmass show up as black because it’s just not soft enough. This is why I’m suggesting a skylight be used, or at least some very large, very soft ambient static lights to normalize the lighting of the scene: to help make up for some of lightmass’s shortcomings. It doesn’t need to be terribly bright, I just think it needs to exist.

konedj - This is looking AWESOME! If you want, you can make multiple instances of the stained glass material to change the shade so that, say, a window not receiving direct sunlight can appear darker than a window that does. Unfortunately, you lose complex specular making lights static, but you gain the most effective way to render stained glass lighting, full stop. Try playing around with surfaces like rougher carpet, sharper wood finish, even sharper marble, until you find a result that looks nice. Personally I would make the benches a lighter color and get closer to using finalized textures for the nave of the church: pure blue is not very interesting, and if you stick with stained glass static lighting, the final color will be completely dependent on the quality of that texture. I would look for places to add incidental lighting, like lamps, or candles to breathe more life into the church than just relying on the sun alone. Don’t get me wrong, the sun is your most important light source, but it doesn’t have to be your only one. With everything combined, this will look absolutely outstanding! It already does :slight_smile:

Wow guys!! Thank you very much for all that information. I’m really learning a lot of lighting here.

  • Thanks!! I will stick to movable on the sun light but I will try adding a skylight with a really low intensity for that.

About the stained glass material instances, I dont know in this material if changing the shade means changing the emissive power value that I did.

Thanks for the texture tips, right now they were just placeholders but now that I’ve uv mapped again I’ll try to do a good ones. I just wanted to be sure that the illumination worked fine before really starting texturing (and I think I did right because now I’ve had to uv map again and start new textures). I will definetly take your advices

I have the lamps, some candelabrums and “tables with candles” that I really want to fill the scene with and also add lights to them. The light I will use is similar to the one in the SunTemple project demo, a red and soft light.
I thought about the lamps, they have 6 candles (so it would be 6 point lights there). I dont know if the point lights will be enough to give light also to the walls and probably to the floor. I took as reference the first pics of this thread.

Thank you very much!! I want to make a good scene that I can use in my portfolio and also learn

Um, if you use a movable skylight, you’re going to lose the stained glass effect, and all GI. Keep that in mind. I know some people advocate light functions for stuff like that, but I personally was unable to get light functions to work properly in a windowed setting. Also, light functions require forward shading, which means you’ll suffer great performance issues when more than one light are in the scene. I recommend static lighting for stained glass. Movable lights won’t even calculate lightmass at all! Movable lights are the worst kinds.

Also, some people are saying skylights don’t work well indoors, and they recommend using an ambient cubemap for that purpose. I assume this is because of the way skylights are not baked in lightmass, they occlude interior spaces. Put some very, very large, soft, dim lights in your space, and capture a generic cubemap to use for an ambient cubemap post-process: you should be able to dim it down there and make it viable.

I’m also trying to create a mockup church scene and light it myself. We’ll see how well it works.

First Built!!! As you can see, the different shaded objects now are gone!! :smiley: Everything is working perfect but the marked parts.
The down part I think I’m able to fix it just with a bsp but I’m not sure about the upper part. Also I would like to figure out if I can fix that without using bsps :slight_smile:


It is looking better, isn’t it?

Nice!

I also tested skylights with interior spaces, and they do work, so you don’t have to worry about it so much.

I made a mock-up of a church with large, stained glass windows. The lighting situation is different here, but here are some values that can help you for final lighting. If you want the soft glowy look, a negative 0.4 bloom threshold gives it a dreamy look. I also have cheap Subsurface Scattering in the marble to help lighten it up.
Stained Glass Texture - Fairly saturated, medium brightness
Light Source - 6
Bloom Intensity - 1.4
Bloom Threshold - -0.4
Auto Exposure Bias - 0.2
Skylight Intensity - 0.15

Wow!! That looks really really nice.

Do you mind if I ask you to upload the project?? That way I can look propertly to the lights, materials and those values.

Thats the quality I would like to achieve really.

Pd: happy new year!! :slight_smile:

Sure! I’m planning on doing more work on it today, too. Aside from all the other aspects I mentioned, I also have grain intensity set to 0.2. A scene like this will have plenty of soft lighting and smooth transitions: adding some noise will really help those transitions look great, and it masks some of the defects from lightmass where the shadows are large and bulky, without much variance. I also upgraded lightmass production lighting to use more rays and make a higher quality bake than default production: without this, the stained glass starts to show banding and it looks really bad. I also have incredibly high values for lightmap sizes: 512 for the chair, 512 for the platform, 512 for the floor, and 64 for the columns because stained glass lighting requires a lot more detail in the lightmap in order to look correct. It’s not a basic solid colored light, the light has a texture to it.

I’m just letting you know now the stained glass texture was from google, and is not free. The marble and stone textures I found for free. I made everything else, obviously not to expectations. Just use this as a reference for lighting, lightmap UVs, and post process/material settings if you need it. When I have the chance, I’ll make a development build and post it here. I would like to take the concept further with candles and wooden pews, too… maybe even make a stained glass texture of my own :stuck_out_tongue:

Here’s another screenshot:

Yeah!! Sure I willl use it as a references for all of that. It is looking pefect :smiley:

Thanks!!

OK, here’s the project to help you out. If you notice, I placed some lights in specific places to help improve the final quality of the scene. It’s not perfect, again, it’s hastily done, and WIP, but it should be enough to get you started. It uses the engine build 4.6.1, so make sure you have that.