And it is absurdly simple to solve!
(Even though some folks claimed it could not be solved!)
I was playing around with YAL from the code archives... the newer 1.4 version today. (As opposed to the actually older "update" version listed after it.)
Anyhow, I looked at a few pages on lightmapping an radiosity trying to find info on how someone else solved the problem, but I couldn't find anything.
Then, it occured to me that a texel that is inside a wall is on the back side of all polygons the wall is made of.
But a texel which is actually obscured by geometry is on the OUTSIDE of the geometry.
It was then that I realised that the only problem with YAL's lightmapping was that one function call had the paramters reversed:
If EntityVisible(LumelPivot, LightPivot)
;If EntityVisible(LightPivot, LumelPivot)
NHits = NHits + 1
EndIf
The original code, commented out, can be found in the LMLightProcess() function.
As you can see, instead of the light looking at the lumel to see if the light can see the lumel, the lumel looks at the light to see if it can see the light. Now, if a lumel is inside a wall, it can see the light, because the wall, facing away from the lumel, will be culled, and the lumel will be lit. But if it is on the outside of the wall, but on the opposite side from the light, a polygon, which is not culled because it faces the lumel, will be in the way, and the lumel will not be able to see the light.
...
There is one problem with this method of lighting however.
With this method, it becomes possible for light to bleed under walls. This will be potentially visible in dark areas.
However, because of the nature of levels being brightly lit, and the fact that you're much less likely to have pixels improperly lit by light, than improperly shadowed by being partly outside of the level or partially inside walls, this is a worthwhile tradeoff.
Also, I beleive that if you sampled each texel from the four corners rather than from the center, and if any of those were shadowed the texel was shadowed, then that would solve that final issue of light bleeding under walls.
Here is a before and after pic from YAL:


You'll notice that something doesn't look quite right with the cube in the center. For one, there appears to be a dark shadow extending out from the bottom of it onto the larger cube. And for another, the sides of it are darker.
I'm not sure exactly what is causing these issues. I beleive that there's couple bugs elsewhere in YAL which is causing these two issues.
I think that the dark edges on the small cube may be caused by bilinear filtering because the areas adjacent to those edges are outside of the area calculated by the lightmap. I think YAL may be calculating lighting info for only those texels which are actually inside the polygons. If so, then the solution is to calculate an extra texel or two outside of the polygons.
As for the dark shadow along the base of the cube... That's caused by the dark area inside the cube leaking out. If you go inside the cube it's the same color as the area inside the cube. Come to think of it, I'm not sure actually why there is any dark area inside the cube at all. The floor under the cube should be able to see the light... Unless... Maybe the cube's bottom side is managing to hide those texels. That could be it I suppose. I'm not posiive though. If so, then it seems that a properly consturcted level would not have this issue because you shouldn't even have a floor inside that cube, nevermind having that cube have a bottom to it.
[edit]
Yes, moving the little cube down a fraction of an inch puts it's bottom beneath the floor of the larger cube, and as a result, the shadow along the lower edge of the small cube which should not be there dissapeared, and a tiny bit of light bleed under the cube showed up, but it's much less visible and would probably be virtually impossible to see with real textures there.
But the dark edges are still on the small cube itself. Have to find some way to calculate extra pixels around the polygosn for the lightmaps... But I'm not very familiar with YAL's code yet.
[/edit]
(Even though some folks claimed it could not be solved!)
I was playing around with YAL from the code archives... the newer 1.4 version today. (As opposed to the actually older "update" version listed after it.)
Anyhow, I looked at a few pages on lightmapping an radiosity trying to find info on how someone else solved the problem, but I couldn't find anything.
Then, it occured to me that a texel that is inside a wall is on the back side of all polygons the wall is made of.
But a texel which is actually obscured by geometry is on the OUTSIDE of the geometry.
It was then that I realised that the only problem with YAL's lightmapping was that one function call had the paramters reversed:
If EntityVisible(LumelPivot, LightPivot)
;If EntityVisible(LightPivot, LumelPivot)
NHits = NHits + 1
EndIf
The original code, commented out, can be found in the LMLightProcess() function.
As you can see, instead of the light looking at the lumel to see if the light can see the lumel, the lumel looks at the light to see if it can see the light. Now, if a lumel is inside a wall, it can see the light, because the wall, facing away from the lumel, will be culled, and the lumel will be lit. But if it is on the outside of the wall, but on the opposite side from the light, a polygon, which is not culled because it faces the lumel, will be in the way, and the lumel will not be able to see the light.
...
There is one problem with this method of lighting however.
With this method, it becomes possible for light to bleed under walls. This will be potentially visible in dark areas.
However, because of the nature of levels being brightly lit, and the fact that you're much less likely to have pixels improperly lit by light, than improperly shadowed by being partly outside of the level or partially inside walls, this is a worthwhile tradeoff.
Also, I beleive that if you sampled each texel from the four corners rather than from the center, and if any of those were shadowed the texel was shadowed, then that would solve that final issue of light bleeding under walls.
Here is a before and after pic from YAL:


You'll notice that something doesn't look quite right with the cube in the center. For one, there appears to be a dark shadow extending out from the bottom of it onto the larger cube. And for another, the sides of it are darker.
I'm not sure exactly what is causing these issues. I beleive that there's couple bugs elsewhere in YAL which is causing these two issues.
I think that the dark edges on the small cube may be caused by bilinear filtering because the areas adjacent to those edges are outside of the area calculated by the lightmap. I think YAL may be calculating lighting info for only those texels which are actually inside the polygons. If so, then the solution is to calculate an extra texel or two outside of the polygons.
As for the dark shadow along the base of the cube... That's caused by the dark area inside the cube leaking out. If you go inside the cube it's the same color as the area inside the cube. Come to think of it, I'm not sure actually why there is any dark area inside the cube at all. The floor under the cube should be able to see the light... Unless... Maybe the cube's bottom side is managing to hide those texels. That could be it I suppose. I'm not posiive though. If so, then it seems that a properly consturcted level would not have this issue because you shouldn't even have a floor inside that cube, nevermind having that cube have a bottom to it.
[edit]
Yes, moving the little cube down a fraction of an inch puts it's bottom beneath the floor of the larger cube, and as a result, the shadow along the lower edge of the small cube which should not be there dissapeared, and a tiny bit of light bleed under the cube showed up, but it's much less visible and would probably be virtually impossible to see with real textures there.
But the dark edges are still on the small cube itself. Have to find some way to calculate extra pixels around the polygosn for the lightmaps... But I'm not very familiar with YAL's code yet.
[/edit]
