Shadow casting uniform llighting


(G0-Gerbil) #1

Dunno if anyone remembers but I asked for this a while ago.
Recently it’s occurred to me I could possibly fake them, so now I’m asking if it would work :slight_smile:

Basically I’d use a point light entity, with or without squared falloff, with a stupidly low fade 0.0000001 etc.

So the light would be pretty uniform over anything but the largest of maps, and would cast shadows.

Is it a goer? Not got radiant in front of me to test it out - hence the question here.


(MindLink) #2

That wouldn’t be ambient lighting, but well… A point light source in your map that casts shadows :wink:
A kind of “shadow” casting ambient lighting is the dirtmapping which was recently introduced in the latest q3map2 version ( ambient occlusion ).


(G0-Gerbil) #3

Bah, ok my terminology is wrong.
I should have said ‘uniform’ rather than ‘ambient’ :slight_smile:

Dirtmapping for me still remains a ‘ermmm ok, not much point really’ feature. I’m waiting to be corrected though :wink:


(MindLink) #4

You still wouldn’t get “uniform” lighting because light intensity depends on the angle of the light-ray hitting the surface. I don’t really get what you’re trying to accomplish actually :slight_smile:


(G0-Gerbil) #5

Ah no, I’m fine with the directional falloff, that’s pretty much a given, since the only way to do that would be to have proper ambient lighting which of course wouldn’t have shadows :slight_smile:
This initially came about from Helms’ deep, where the sky is so high over the terrain, that lighting is hard to do. Since I am sick of washed out lighting maps, I removed all ambient / _minlight stuff, which allows me to have lovely pure black. The problem is, in some cases I was getting it but didn’t want it (eg the back of the main wall).
I wanted ‘localised’ (in so far as objects stopped it, IE shadow casting) dim lights that have no falloff, IE they carry on as far as they can until stopped by an object. An extremely low fade should solve this.


(ydnar) #6

q3map_skyLight <brightness> <iterations>

Example:

q3map_skyLight 120 3

Try it. It’s yummy.


(G0-Gerbil) #7

I am already using skylights, still no joy.
What is the technical method of skylights working? Do they have no attenuation?
I seem to recall they still do, which accounts for my problem.

I see no-one is answering my original (if badly worded!) question, so I’ll repeat it here, since this is all I need for now to fix my problem:

Can I fake no attenuation on a point light with an extremely low fade value?


(phobos) #8

I think someone may have done what you’re thinking of. A while back I remember a post of somebody showing off their 'toon shaded map. I think the post was about “radiosity and fog with toon shaders”, but not that exact name. It was this mostly grey techno looking map that was quite impressive. It had uniform lighting that was directional, but WITHOUT shadows. It looked quit good.


(ydnar) #9

q3map_skyLight lighting works regardless of how high your sky is above the terrain. If it’s not lighting up the map’s outdoor areas enough, then up the brightness.

Make sure your shaders are listed in shaderlist.txt also.

y


(G0-Gerbil) #10

does skylight project in every direction, or is it aligned to the sunlight dir?
I was under the impression skylight was a direct and better alternative to normal surfacelights specifically for skies.


(rgoer) #11

oops


(rgoer) #12

That is just skylight illumination. The skylight used was q3map_skylight 300 5, and the map was compiled with -gamma 2 -compensate 4.


(ratty redemption) #13

edit: my understanding was wrong, see rgoer`s explanation below, to avoid confusion.

as I understand it the iterations, which are the 2nd value sets up multiple suns around the diameter of the sky, the more iterations the more suns casting light from different angles.

maybe the elevation of the main q3map_sunext is used for the q3map_skylight suns? …and if their first value isn`t too bright, then we can still have stronger shadows and specular highlighting from the main sun.


(rgoer) #14

Ratty: that is nothing like how skylight works ;^) Here is a break-down…

Q3Map2 creates a hemispherical “sky” and places multiple sun lights on the surface of this hemisphere spaced out by uniform angular division. Recently, the “stadium shadow” effect from old-world skylight was remedied by rotating the hemisphere in a spiral, rotating (ITERATIONS - 1) * 4 times around, with (ITERATIONS - 1) elevation changes. It’s pretty grand. The color of skylight is determined by qer_editorimage/q3map_lightimage.


(rgoer) #15

BTW you used to need 5 iterations to avoid “stadium shadows” … now you only need 3 or 4 (making for much quicker compiles). You only will run into a situation calling for more than 4 if you are using really high resolution lightmaps (low -samplesize, low _lightmapscale, etc).


(ratty redemption) #16

oh, sorry, and thanx for explaining.

and is the number of suns on this hemisphere always the same, independent of the number of iterations? …certainly the way you described this, does sound cooler then how I previously thought it worked :slight_smile:


(rgoer) #17

The number of iterations is either equal to or directly proportional to the number of suns created… I think it used to be equal (old-world skylight), but now it is merely proportional to (many more suns created in the new skylight algorithm).


(ratty redemption) #18

thanx and it makes sense, as I noticed we get longer compile times the more iterations we have, although it does seem faster then the old skylight, and it definitely looks better, as demonstrated in your pics above :slight_smile:


(G0-Gerbil) #19

I might add that those pics look like you are building the home of the Smurfs :slight_smile:

I think, given the above comments by people, I know why Helm’s Deep has this lighting problem.
Basically one end of the terrain is extremely high, so while the distance from the sky to the back of the wall isn’t a problem, what IS causing this extreme darkness is simply the fact that the wall, being low, has an extremely high surface normal -> skylights angle (probably 70 degrees or higher).
Naturally, a high angle gives extremely low diffuse lighting, making it very dark.
So I’ll still have to run with some additional lighting, which cough might be able to be using, say a point light with low value and low fade value?
Please answer someone, would that work? :smiley:


(RaP7oR) #20

@Gerbil ( and everyone else who wonders wtf Ambient Occlusion does ) :

Here’s some additional Pages that show Ambient Occlusion in Action - i hope it clears up what it does, a bit :).

http://zj.deathfall.com/ambientocclusion.htm
http://zj.deathfall.com/ambientocclusion2.htm