Sunlight + map = bang head on desk


(Gonk) #1

I’m attempting to do an outdoor map with fancy-pants lightmapped terrain and all that fun stuff in Jedi Academy. I’m using the GTK Radiant 1.3.12-RC3 build of Radiant (which is testing JA support). I’m using a portal skybox, with 4 entity suns (you’ll understand why there’s 4 soon enough).

I’m having one HELL of a time trying to get this map to light in a way that is somehow logical. My main problem is, I either get not enough light from the suns, or too much. I can up the intensity till the cows come how, and there are still parts of the level (buildings, really), that is all outdoors, mind you, that are PITCH. BLACK. I don’t understand this at all.

I mean, the suns are all at a fairly high angle (around early morning, so say 10 or 11am), and they SHOULD be catching the sides of these buildings just fine, and lighting them accordingly. Apparently the engine just doesn’t agree, thus I get areas of the map that are lit beautifully (penumbra, although not really pronounced due to the high angle of the suns, does a lot), and then I have areas that are pitch black in an otherwise sunny, open map. It’s inexplicable. I’ve compiled with radiosity, without radiosity, etc. If I could get a version of q3map2 toolz supporting JA, I’d be using that to try EVERYTHING I COULD POSSIBLY GET MY HANDS ON to get this lighting to NOT make these buildings pitch black.

All I want to know is how in the hell can I get a somewhat LOGICAL sunlit map to work? I’ve tried sky shader lighting, that was even worse. I’ve tried individual entity lights combined with either the sky shader or the entity suns, and that just looks unnatural and bad. WHAT AM I MISSING?!

I’d much prefer to actually be working ON THE LEVEL rather than futzing around trying to get the lighting to do something it should be doing anyway by my understanding. I’ve gotten quite annoyed as of late.

Does anyone have any suggestions on how to effectively use sunlight to provide light on buildings that are OUT IN THE OPEN AND SHOULD BE LIT ACCORDINGLY ANYWAY?! grabs the gun Cuse you Q3 engine…

I’m slowly losing it…


(Fracman) #2

Well, finding the correct lighting is very tricky, it depends on so many factors… skybox, sun, light color and intensity, brushes, textures…

Best thing would probably be to set up a small map first where you vary and try out the different parameters until you got what you want.

You could write the specific shaders in a batch job and let q3map2 render some samples. Just like a set of exposures in photography.


(ydnar) #3

Try adding q3map_skyLight to your sky shader. Also, you can achieve a nice penumbra effect with a single sun (entity or shader).


	q3map_sunExt 1 .95 0.85 96 -30 26 2 32
	q3map_lightmapFilterRadius 0 160
	q3map_skylight 40 3

y


(Gonk) #4

What exactly does skyLight do? Never heard of it, honestly.

Chalk that up to lazyness, probably. :slight_smile:

Edit: So I removed the entity lights and have gone back to attempting to use a sky shader. Here’s said shader:

textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_sunEXT .5 .37 .19 250 180 107 2 32
		q3map_lightsubdivide	512
		q3map_lightmapFilterRadius 0 160
		q3map_skyLight 40 3
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

This gives me exactly the same problem as described above. Some areas lit, and buildings pretty much pitch black. AND the light is coming from the complete opposite direction of where the sun looks like it is in the sky texture. I’m lost as to what to do…


(ydnar) #5

Is your sky shader listed in shaderlist.txt?

Remove q3map_lightSubdivide. It’s not necessary for sky light. Also, the brightness of your sun is way too high. It’ll oversaturate everything it hits, resulting in harsh blocky shadows. Turn it down to half that at the most.

Also, add

q3map_lightimage textures/skies/dune_up.tga

so it can get the blue color for the sky properly.

You might want to turn up the brightness of q3map_skylight from 40 to 60 or 70 as well.

y


(phobos) #6

I think perhaps it’s your angles, since elevation is mesaured as 90 degrees from the horizon. Here’s some of the original q3 sky shader comments:

// q3map_sun <red> <green> <blue> <intensity> <degrees> <elevation>
// color will be normalized, so it doesn't matter what range you use
// intensity falls off with angle but not distance 100 is a fairly bright sun
// degree of 0 = from the east, 90 = north, etc.  altitude of 0 = sunrise/set, 90 = noon

So, your shader would be a sun of 250 intensity originating from 250 W/SW and the elevation looks to be incorrect. AFAIK it has to be 0 deg horizon, to 90 deg pointing straight down. 107 might be causing it to loop and shoot upward perhaps.


(Gonk) #7

Shader in its current form:


textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_lightimage textures/skies/dune_up
	q3map_sunEXT .5 .37 .19 125 180 107 2 32
		q3map_lightmapFilterRadius 0 160
		q3map_skyLight 70 3
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

Yields this: http://www.jedilegacy.net/gonk/screens/ja/shot0009.jpg

Ignore the parts of the buildings where you can see anything on them, as they’re entity lights doing that. I was testing them to see how they’d look. (It still looks unnatural.) The only parts of the buildings that are actually catching light from the sky shader is the floor. Not too mention that it’s just too dark overall.

I can’t recall if I had mentioned having a portal skybox or not. But I do. The light comes in through that, and, as you can see, even the buildings in said skybox are too dark… I’m not sure what’s happening here. Compile options were bsp -meta, fullvis, light -fast -filter, just because I’m headed to work and needed a quick compile.


(phobos) #8

Replace your angle of 107 with 73 (if I’m thinking correctly, this might be what you want ). Do a quick compile and post a screenie, the light should be “desert” like with narrow shadows coming off the buildings at their base.


(Gonk) #9

Current Shader:

textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_lightimage textures/skies/dune_up
	q3map_sunEXT .5 .37 .19 175 180 73 2 32
		q3map_lightmapFilterRadius 0 160
		q3map_skyLight 70 3
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

And some in-game shots: http://www.jedilegacy.net/gonk/screens/ja/shot0010.jpg and http://www.jedilegacy.net/gonk/screens/ja/shot0011.jpg

Compile options: BSP -meta, fullvis, Light -fast -filter -super 2 -bounce 8 (as stated before, can’t get q3map2 toolz to work with JA right now, so I’m stuck with the crapulent standard Radiant compile options, otherwise I’d be using -samples instead of -super and probably adding in -shade and -shadeangle.)

Sooo… the good thing is the light is coming from the correct direction appropriate to the sun.

The bad stuff: still too dark overall. It doesn’t look ANYTHING like a mid-day setting. At all. The terrain is too darkly lit, the buildings still aren’t catching any light (or, if they are, it’s barely noticeable against the bright blue sky), and it seems as if the penumbra isn’t showing up at all.

Grrr… this is annoying. Any suggestions?


(Valhue2) #10

i think phobos was on to something… but its possible he got his numbers switched… Looking back at what ydnar said

q3map_sunExt 1 .95 0.85 96 -30 26 2 32

now If what phobos said was true (taken from the shader manual i presume)

im quoting the changelog

q3map_sunExt <r> <g> [b] <brightness> <angle> <elevation> <deviance> <samples>

Now im looking at your numbers Gonk

q3map_sunEXT .5 .37 .19 175 180 73 2 32

your RGB is .5, .37, .19. The brightness is 170 (im looking at ydnar’s, his is a decimal… maybe it only accepts values up to 1?), now your angle is 180… which if 0 is the east and 90 is north… then 180 would be west… (which would technically = 0 on the horizion) so in essence, you arent pointing light down at all… more parallel to the ground,… the mini shadows you are seeing would most likely be the result of bounced light… To keep things moving, 73 is your deviance variable (the ammount of jitter?) and 2 is your sample rate… now the 32 has me buggled…? perhaps more sampling?

so try changing 180 to 100 or 90? I dunno… im only speculating.

V^2


(Fracman) #11

I’d rather raise up the q3map_skyLight setting, try q3map_skyLight 100 3 just to see the difference…


(Gonk) #12

Weeee! Big improvement on this compile. Here’s the current shader:

textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_lightimage textures/skies/dune_up
	q3map_sunEXT .5 .37 .19 175 180 73 2 32
		q3map_lightmapFilterRadius 0 160
		q3map_skyLight 100 3
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

and here’s the results of said shader: http://www.jedilegacy.net/gonk/screens/ja/shot0012.jpg and http://www.jedilegacy.net/gonk/screens/ja/shot0013.jpg

Compile options: BSP -meta, fullvis, light -fast -filter -super 2 -bounce 8

As you can see, the lighting is much more realistic and much improved in terms of brightness. The only things I’m wondering about now are: a.) why is there no apparent penumbra (might be something as simple as the high angle of the sun)? b.) How can I get just a bit more light coming in the direction opposite the sun so that I get a slightly less black shadows on the sides of the buildings that are opposite the sun? I mean, if you look at normal sunlight during mid-day on a bright sunny day, you won’t see one side of a building being pitch black, etc. I’m trying to avoid using _minlight. :slight_smile: Any suggestions?


(Fracman) #13

Nice shots, it comes closer…
There are shadows, look down below the bridge. It seems the lightmap is wrong there, the shadows are not blurred and look strange.
And the overall brightness is too strong imho. Now you can lower the skylight setting a bit. Try 85 instead of 100.
If you want more light from the opposite side of the sun, add some ambient light.
And I think the bounce process adds more light. Pay attention not to change too many parameters at once…


(Gonk) #14

How do I go about adding ambient light?

Never really done it before…


(Fracman) #15

Well, you better should try to make the skylight correct.
Ambient is the last setting you should use… because it raises the whole light setting, and therefore is bad (you won’t have any really dark areas then).
You have a skybox and assigned a lightimage, so you may try the q3map_surfacelight parameter before. It sets the amount of light emitted by the lightimage.
And as Ydnar wrote a few posts up there, you may still reduce your sun brightness as well.


(ydnar) #16

Change your sky to use these values exactly, recompile, and then see what it looks like. Your current sun parameters are quite strange, and likely causing the problem.


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

Oh, and make sure you’re using Q3Map 2.5.8 or later (2.5.9 shipped with GtkRadiant 1.3.12 for JA etc). Otherwise, you’ll need to use:


	q3map_sun 1 .95 0.85 96 -30 26
	q3map_lightmapFilterRadius 0 160
	q3map_skylight 60 3

(q3map_sunExt first appeared in 2.5.8)

Also, are you using any strange shaders like “outside” or anything covering those buildings like odd clip shaders? If so, you might want to check to see if they’re marked trans.

Additionally, make sure your sky brushes are all sky, without other textures or caulk on the backsides.

y


(Gonk) #17

I’m using q3map2 2.5.9. (Just got it with the official release of GTKRadiant for JA). I changed the sky shader as you suggested, ydnar. Here it is in its current form:

textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_lightimage textures/skies/dune_up
	q3map_sunExt 1 .95 0.85 96 -30 26 2 16
   		q3map_lightmapFilterRadius 0 160
   		q3map_skylight 60 3 
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

My major problem with the lighting is that the sky textures are oppressively bright compared to the, well, lack of light of the rest of the level. This makes the entire level seem darker overall. The pitch black shadows on the buildings weren’t helping the matter. I don’t understand how you guys could say that it’s TOO bright, honestly, I let a few people see a quick beta of it and they all said it was too DARK. Which I have to agree with. The skylight 100 made it slightly better, though honestly it still needs to be brighter. It’s just dark overall right now. If this latest compile with the shader above doesn’t quite go, then I’m gonna try reverting to the previous one and upping the skylight some more. It seems as if I’m just not getting ENOUGH light, somehow.

The only possible reason for this that I can think of is that there’s not enough light getting through the portal skybox somehow. The light is coming off of the skybox, as you have to use the sky_nodraw shader in JA to get the portal skybox to show up… right? I gleaned that info from one of the Raven maps.

So to make it a bit clearer: The actual playable portion of the map is surrounded by a sky_nodraw box, essentially. The light from the sky shader is coming into the level proper from the portal skybox. Only the portal skybox has the above sky shader. Here’s the shader for sky_nodraw, pasted, untouched, from Raven’s skies.shader:

textures/skies/sky_nodraw
{
	qer_editorimage	textures/skies/sky
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/system/caulk 512 -
}

I can’t very well modify that to include surfaceparm trans, because that’'d give me a very big leak. I’m kinda stuck as to what to do here…

edit: also no clip shaders or outside or anything like that covering any of the buildings. I do things like hinting and clipping last.

Here’s the latest shot of the level with the latest sky shader modified with the settings you suggested (first shader in this thread), ydnar: http://www.jedilegacy.net/gonk/screens/ja/shot0014.jpg

Compile options: BSP -meta, fullvis, light -fast -filter -super 2 -bounce 8

Pretty much no lighting at all. (You can see fairly well where I have a few entity lights, however. :))

(I keep editing this…) Also, the sky brushes are ALL sky.


(Fracman) #18

Well, you’re right, in your last screenshots, the buildings are indeed too dark. The skybox seems to have 100% light, but only 50% is coming through. So you may again rise up the skyLight brightness parameter.


(Gonk) #19

In shot 14 EVERYTHING is too dark… at least that’s how I’m seeing it. I mean… the entire map is black, save for the portal sky and the sky shader, and parts that are catching light from the entity lights…

Ok, reverted to the previous shader with a few tweaks:

textures/gonk/kalimasky_bright
{
	qer_editorimage	textures/skies/sky.tga
	q3map_lightimage textures/skies/dune_up
	q3map_sunExt .5 .37 .19 175 180 73 2 16
   		q3map_lightmapFilterRadius 0 160
   		q3map_skylight 120 3 
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	q3map_nolightmap
	skyParms	textures/skies/dune 512 -
}

And the obligatory screens: http://www.jedilegacy.net/gonk/screens/ja/shot0015.jpg and http://www.jedilegacy.net/gonk/screens/ja/shot0016.jpg

Compile options: BSP -meta, fullvis, light -fast -filter -super 2 -bounce 8

This is more in-line with my original intention. All I’d like to do is get slightly more light on the buildings in the skybox and on the faces of the buildings opposite the sun’s direction. Not too much… I may take the jpgs for the skybox and actually reduce the gamma on them some, as well… or use a whole different skybox texture or something…

edit: Tried a compile using ambient set at 50, and the same color values as the sky and it really didn’t do anything noticeable. I’m wondering what to do now…


(ydnar) #20

OK.

I think I’ve figured out what your problem is.

The portal sky shader you’re using MUST be listed in shaderlist.txt and it must have “surfaceparm sky” or sun/skylight (those set the sky surfaceparm).

The reason for this is because in order for sky/sun lights to work, they MUST trace through a sky surface of some sort.

This would explain why your map isn’t being lit up at all, while the portal sky is.

One thing you should try is replacing the nodraw sky with the sky you’re using in the portal sky and recompile.

BTW, you only need to run -light -fast to do a quick test. Save the bounces/supersampling for final compiles.

y