Lighting experiments, sample map and source


(Ifurita) #1

Need to tweak lighting, or just trying to figure out what lighting you need for your map?

I put together a small map with source to try out a couple of different intensities, colors, and dynamic light styles:

http://www.planetwolfenstein.com/4newbies/light_test.zip
The source .map file is inside the pk3 in the /maps folder

Basically 10 identical rooms with a variety of lighting

  • Intensity 300, white
  • Intensity 150, white
  • Intensity 150, spotlight
  • Intensity 150, High Pressure Sodium
  • Intensity 150, Mercury Vapor
  • Intensity 150, 40W Tungsten
  • Intensity 150, Fast Pulse + 4 x 30 lights to provide overall room lighting
  • Intensity 150, Flicker + 4 x 30 lights to provide overall room lighting
  • Intensity 150, Candle + 4 x 30 lights to provide overall room lighting
  • Intensity 150, Candle + 4 x 30 floor light for more illumination

Command map descriptions tell you what kind of lighting is in each room

Source links:
http://members.shaw.ca/jimht03/light.html <— light colors
http://www.modsonline.com/Tutorials-read-72.html <— dynamic light styles
http://planetquake.com/qworkshop3/tutorials/light-help/index.html <— lighting a map

Enjoy


(Loffy) #2

Thanks! Will defintely come handy!
I love dl:ing sample maps and running around in them to check out stuff.
//L.


(Detoeni) #3

What compile options do you reconmend for this?
I ran “-fast -samples 2” and thought most of the rooms were a little on the dark side.(runnig game on default settings)

The first source link is a nice one, I’v not seen it before.

Have you tried adding “fade” “(default 1) 0.9>0.1” to you lights? A value of 0.1 will fade a relative low value light over a larger area. Cominations of normal and fade lights can get some very nice effects.

This is a good example for folks, good lighting can be a difficult area for some new mappers, it seams all to often its passed over along with shaders.


(Ifurita) #4

i used the default (single) bounce -8 option from the BSP menu <— Noob

bsp_Q3Map2: (single) -light -fast -samples 2 -filter -bounce 8

I did not try fade, though that might be a good option for the flicker room and the one with ground lighting, as I wanted to bring the light level up a bit and used 4 point lights. I can add another 2 rooms to contrast 2 fade options with the 4 discrete point lights


(Ifurita) #5

OK, added some fade lighting at various intensity and fade values - very cool stuff.


(Detoeni) #6

Ahha! -bounce 8 added and its much better.
Nowt wrong with the bsp menu…once you edited the options (filter needs to go, it works agains samples).


(Ifurita) #7

http://www.planetwolfenstein.com/4newbies/light_test_0331.zip <— updated with fade lights

I tried a couple of intensity/fade options

150, fade .75
150, fade .25
50, fade .25 <— in one of the dynamic lighting rooms
100, fade .5 <— in one of the dynamic lighting rooms
150, fade .75 <— in one of the dynamic lighting rooms

Definately bears more experimentation

cm marker i is repeated 4 times because I ran out of letters :frowning: but the descriptions are accurate

Also moved the crates so that you can get a better idea of what the shadows look like


(EB) #8

Just curious, have you ever applied your own shader to a dlight ?

dlight entity keys/values(for the curious)
“style” value is an int from 1-19 that contains a pre-defined ‘flicker’ string.
“stylestring” set your own ‘flicker’ string. (ex. “klmnmlk”). NOTE: this should be all lowercase
“offset” change the initial index in a style string. So val of 3 in the above example would start this light at ‘N’. (used to get dlights using the same style out of sync).
“atten” offset from the alpha values of the stylestring. stylestring of “ddeeffzz” with an atten of -1 would result in “ccddeeyy”
“shader” name of shader to apply
“sound” sound to loop every cycle (this actually just plays the sound at the beginning of each cycle)
-------- SPAWNFLAGS --------
FORCEACTIVE toggle makes sure this light stays alive in a map even if the user has r_dynamiclight set to 0.
STARTOFF means the dlight doesn’t spawn in until ent is triggered
ONETIME when the dlight is triggered, it will play through it’s cycle once, then shut down until triggered again
-------- NOTES --------
Stylestring characters run at 10 cps in the game. (meaning the alphabet, at 24 characters, would take 2.4 seconds to cycle)
Use color picker to set color or key “color”. values are 0.0-1.0 for each color (rgb).

styles:
1 - “mmnmmommommnonmmonqnmmo”
2 - “abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba”
3 - “mmmmmaaaaammmmmaaaaaabcdefgabcdefg”
4 - “ma”
5 - “jklmnopqrstuvwxyzyxwvutsrqponmlkj”
6 - “nmonqnmomnmomomono”
7 - “mmmaaaabcdefgmmmmaaaammmaamm”
8 - “aaaaaaaazzzzzzzz”
9 - “mmamammmmammamamaaamammma”
10 - “abcdefghijklmnopqrrqponmlkjihgfedcba”
11 - “mmnommomhkmmomnonmmonqnmmo”
12 - “kmamaamakmmmaakmamakmakmmmma”
13 - “kmmmakakmmaaamammamkmamakmmmma”
14 - “mmnnoonnmmmmmmmmmnmmmmnonmmmmmmm”
15 - “mmmmnonmmmmnmmmmmnonmmmmmnmmmmmmm”
16 - “zzzzzzzzaaaaaaaa”
17 - “zzzzzzzzaaaaaaaaaaaaaaaa”
18 - “aaaaaaaazzzzzzzzaaaaaaaa”
19 - “aaaaaaaaaaaaaaaazzzzzzzz”

I am just being lazy about it…hehe

-Cheers


(Ifurita) #9

so what exactly does each letter mean?


(MrLego) #10

Which letter is the brightest intensity a or z?


(Detoeni) #11

I think they run in a loop z leads to a, with m,n being at the other end of the scale. Cant remember which is bright and which is dark.
I might be wrong, its been a very long time since I last tried them.
I also rember having problems with the dlight affecting all light entities in leafs visable to the one with the dlight in.


(EB) #12

Good thing to clear up, let’s get this sorted to a science.
When I get bored this weekend I will test the values for each letter.


(Mammoth Entertainment Inc) #13

i like the idea, one thing i hate is tryin diferent lights out and compiling so much, now its all at my finger tips…


(Ifurita) #14

Feel free to add to the source, recompile it, and shoot it back to me.


(CooperHawkes) #15

IIRC a=no light, z=full brightness… since every character defines the brightness for a tenth of a second the following string should result in a blinking light, that is half a second on, 1.5 seconds off, 0.5 seconds on, 1.5 seconds off, and so on…

zzzzzaaaaaaaaaaaaaaa

so it should result in something similar to light style 17 to 19…
BTW: the only difference of these 3 styles is the phase shift of the blinking

and remember: dlights kill framerate :frowning:


(Ifurita) #16

Yep, you can definately see that when you wander into the 3 rooms with dlights


(CooperHawkes) #17

lightstyles on ordinary lights are much better in general… try to add key “_style”, value “<integer>” to one of your lights… q3map2 should generate a special shader script which does the flickering for you :wink:


(Ifurita) #18

yes, but it just eats up a lot of FPS. in fact, I included the shaders and they are very large


(CooperHawkes) #19

ooops, I wasn’t aware that you already use these kind of lightstyles for ordinary lights… I was thinking you are using dlights… my fault :frowning:
llame excuse: I was not able to test the map at work… but if I had read your initial post more carefully I should have noticed that :-/


(EB) #20

even good people make mistakes buddy…
I have several ideas in mind for this ‘avenue to pursue’ but is it worthwhile ? I would like to setup a good example pack with explanations. I won’t lie, I will need a little help with it’s progress to extend the information and other ways to implement the use of these lighting effects but I am more than willing to get the ball rolling.( Let’s have lunch.)

-Cheers