Lighting issues


(MindLink) #1

Hey there…
I’m pretty busy working on my map, but today I stumbled upon a big problem. I changed my sky-shader from a night one to the fueldump sky shader, just for testing issues, and noticed there’s a big problem there :
Some walls get absolutely NO light though they should be in direct sunlight. I’ve tried switching compiler from 2.5.7. to 2.5.8. and 2.5.10test1 , changed the shader, used sunExt, the normal sun… But it didn’t help. It’s always walls facing south, though not all walls facing south are “unlit” … Here’s a small picture :

Notice the wall with the door and the many window-holes to the front? Yeah, it’s dark, though as you migth see the sun is coming from the upper left and really SHOULD illuminate the wall. There’s nothing big casting shadows behind the camera, just another wall of the same height which shouldn’t cast a shadow THAT big, and after the wall there’s the skybox.

The shader used is the predefined one from fueldump, with 210 angle and 28 elevation of the sun. If I switch the angle to 230 the wall is fully lit, but others still stay dark.

Any help on this would be appreciated since I’m really stuck.


(ydnar) #2

Nice looking map. Recognize those textures from somewhere…

Can you post your sky shader?

y


(MindLink) #3

Hehe thanks… Most of the buildings in the map are based on your texture stuff, loved those the instant I saw them and thought they should be put to good use…

Well here’s the skyshader (a copy from ETs fueldump)

textures/urbanescape/escapesky
{
qer_editorimage textures/skies/fueldump_clouds.tga
q3map_lightrgb 0.8 0.9 1.0
q3map_skylight 85 3
q3map_sun 1 .95 .9 200 210 28
skyparms - 200 -
surfaceparm nodlight
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm sky
{
map textures/skies/fueldump_clouds.tga
rgbGen identity
}
{
map textures/skies/fueldump_clouds.tga
blendfunc blend
rgbGen identity
tcMod scroll 0.0005 0.00
tcMod scale 2 1
}
}


(MindLink) #4

I made another screenie with “r_lightmap 1”, just for completeness sake.
As you may notice, other structures in the background suffer from the same problem, though it only seem to be straight walls facing south.


(ydnar) #5

Comment out the q3map_skyLight and q3map_sun lines and add the following to your shader and recompile:


	q3map_sunExt 1 .95 0.85 96 -30 26 2 16
	q3map_lightmapFilterRadius 0 160
	q3map_skylight 60 3

The angle you have your sun at is almost nearly west, with a slightly northern bias, which would leave southern facing walls nearly black.

You didn’t do anything like cover those walls in something non-transparent, did you? Or caulk or texture with a different texture the backfaces of your sky brushes?

You might want to have your sun with a southern bias for a european map (being in the northern hemisphere).

y


(MindLink) #6

Well I could post other screenshots where it is more obvious that the walls SHOULD be lit but are not. As you can see in the background of the second image one of the houses actually is lit fully although the wall faces the same direction as all those other unlit ones.
The walls are not covered in anything and all skywalls are completely textured with the sky from all sides.
I guess I didn’t notice these errors before because it was dark anyways with the night sky.

Screenshots using your modified shader :

Come to think of it, I think I retextured these walls in GTK per face recently, maybe that’s the source of the problem…? I’ll strip those things of their texture and do them again and have a look. But not now, have to go to bed, it’s getting late over here… :wink:

Thanks for your help so far.


(Emon) #7

Only thing I can think of is that some of the sky surfaces are projecting light one way, and the others another way? You could try an entity sun.

But hey, those are really nice shots, I like your detail in the debris.


(ydnar) #8

Sky/sun light does not come from surfaces. Entity suns are no different.

They are essentially just an infinite line from each sample point at the angle of the sun. If they can trace through a sky surface without tracing through anything else, then the sample point is lit.

What’s going on here is a mystery to me. The only thing I can think of is something’s blocking the light from hitting that wall, most likely some form of a clip brush (player or otherwise) that isn’t properly set to surfaceparm trans.

Can you recompile without any _minlight or ambient?

y


(MindLink) #9

Well some brush obstructing the sight is pretty improbable I guess since it would only be in the way if the wall is facing south (you can see that the little trims on the unlit walls are actually lit if they don’t face south and the room with the broken window is lit too by sunlit at the ground)…

I did a recompile without any _minlight options (and after retexturing some of the faces) :

http://enigma79.bei.t-online.de/lighting5.jpg

http://enigma79.bei.t-online.de/lighting6.jpg

http://enigma79.bei.t-online.de/lighting7.jpg

http://enigma79.bei.t-online.de/lighting8.jpg

No help… This is really frustrating for me… I got some additional skywalls inserted at some places in the level to help block visibility, but that shouldn’t really be a cause for that problem, should it? All are using the same shader.

Well I can send you the map if you’d like to have a closer look at it, you should have nearly all of those extra textures used on your disk anyways…


(MindLink) #10

I remade the complete skybox and rebuilt one of the walls affected from scratch, didn’t help anything… sigh I’m really out of ideas… :frowning:


(ydnar) #11

OK, I’d like to take a look at your map.

Could you section off that part that’s exhibiting the error and retexture it using default ET textures? That way we can narrow the problem down and have a map that won’t take very long to compile.

My email address is available on my site.

y


(ydnar) #12

Found the bug.

The reason southern-facing walls weren’t being lit by sun/sky lights was because your entire map was further south off the origin than it was deep.

IE, the distance from the origin in the Y axis was greater than the Y size of the map.

This fubared a particular optimization in the lighting code, resulting in no sun/skylights being allowed to light walls facing south.

It will be fixed in the next version (2.5.10-test-2). Hopefully releasing later tonight.

Thanks!
y


(MindLink) #13

:banana: :banana: :banana:

Thank you! :smiley:


(ydnar) #14

Q3Map 2.5.10-test-2.

Bling

y


(MindLink) #15

Works perfect :slight_smile: Yay :clap: