Lighting Issues

N_wasabi

L1: Registered
Jun 16, 2018
6
0
Hello,

I am quite new to Source mapping and I've come across a peculiar problem, where shadows are rendered incorrectly on adjacent brushes. I was following UEAKcrash's mapping tutorial. Everything was fine until Chapter 2 Episode 3, which involved clipping a brush to make doorways. The result was this:

eIAEyX6.jpg


Strangely, when viewed from inside the room which this wall formed (with a generic light entity inside the room), this doesn't happen:

XJndvhh.jpg


Furthermore, I tried making another map, with custom textures, and the same problem appeared, except with the weird shadows occurring not only when two brushes were adjacent to each other, but also on a single brush alone:

C66L9FR.jpg


VMF file for the first map is attached. Any help would be greatly appreciated.
 

Attachments

  • first_map.vmf
    57.8 KB · Views: 142

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
Can't look at it ATM, but I assume all the brush faces are aligned and on the same plane?
 

N_wasabi

L1: Registered
Jun 16, 2018
6
0
Can't look at it ATM, but I assume all the brush faces are aligned and on the same plane?
Yes.

It seems this an issue involving the skybox - when I replaced it with standard dev textures, everything turned out to be fine.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
What if you remove environmental lighting but keep the skybox? Delete your light_environment (temporarily, perhaps create a new VMF if you don't want to lose you sky lighting settings), but keep your skybox brushes, then recompile.
 

Another Bad Pun

In the shadows, he saw four eyes lit by fire
aa
Jan 15, 2011
802
1,845
I looked at your .vmf. Everything seems as it should be - your brushwork is also pretty nice! Your lightmaps are okay and the portalfile doesn't seem to show any visleaf cuts that would cause an issue like this.

The issue has to do with smoothing groups. VRAD is baking this particular wall to be lit slightly differently on the outside because it's actually made up of four different brushes. So, for mysterious reasons, VRAD isn't smoothing the four faces together. Fortunately, there's an easy fix.

In situations like these, select the outside wall faces with Face Edit and then select Smoothing Groups - assign the faces to Smooth Group 1. Click apply and you're done!
The Group Number just tells VRAD that all of those faces should be smoothed together - the second time you do this, you would select 2 and make a second group.


smooths.PNG


After a compile... it's all fixed!
20180621204419_1.jpg


But that still leaves the question: why are there no issues on the inside of the spawn? My guess is it has to do with the way they were lit. The interior has two separate light entities on opposite corners of the wall. For whatever reason, VRAD understands that setup and smooths it all without a problem.

Lighting issues like this in Source are seemingly random, so most people don't bother to fix them until later on in development. Other things that can cause similar looking issues are visleaf cuts (VRAD uses some info from VVIS to light surfaces) and misaligned lightmaps.
 

N_wasabi

L1: Registered
Jun 16, 2018
6
0

Thank you so much! I was about ready to give up. Interestingly, once I grouped the outer faces together, the inner faces, which were fine previously, began to have the same problem. Assigning the inner faces to smooth group 2 fixed it.

What if you remove environmental lighting but keep the skybox?

Deleting light_environment and keeping the skybox didn't change anything. It seems this glitch is solely due to the skybox.
 

N_wasabi

L1: Registered
Jun 16, 2018
6
0
Another issue has popped up:

I again have several brushes making up a surface. Each brush has a different texture, and in order to get them all to fit in right, I've rotated some of the textures using the face edit tool. However, this causes strange lighting problems similar to the above screenshots. Setting the texture rotation to 0 makes everything fine. The face edit tool has both align to world and align to face boxes checked, and I can't uncheck either one.