Light flashing in weird rhythm


(huPoo) #1

I found by accident a way to make lights flashing (not just fading in/out, but really going on/off) in weird rhythm and now I’m thinking if it’s possible to somehow control the rhythm. Probably someone else has had the same accident before, maybe it’s even tutorial somewhere but I couldn’t find anything by search. Anyways how I did it:

I was making a spotlight but I accidentally swapped the target&targetname values on light and not_null entities. So I had not_null->light instead of light->not_null. I tested the map without knowing of my accident and was pretty nice surprise to see the lights flashing. After a few minutes of research I came to conclusion that the light has some sort of rhythm, though it looks quite random, and it changed when I moved the light’s position in the map.

So, now I’m thinking of am I super noob yet again and is there a simple way to control this rhythm and stuff, cause I sure haven’t figured it out, yet.


(pazur) #2

Are you using lightstyles? I think there is a key to control that, but I don’t remember exactly. It might have been dlight. (I used lightstyles in a Jedi Academy map - I controlled the lights by an entity)

This is a screenshot of a lightstyle controlled by an entity (func_timer). Maybe you could write a script to control the light. I’m not sure if that works in ET though. Raven added some special entities in Jedi Academy.

like:

alertentity mylight
wait 500
alertentity mylight
wait 200


(Pegazus) #3

Woah that lightning is cool :smiley: ^^ I never encountered that light flashing :frowning: Would be cool to see it.


(pazur) #4

Thanks Pegazus

Found something:

q3map_lightStyle N

Used to set light styles on surface lights for lightmap flickering/waveform effects. N takes the form of a number between 1 and 31, that references the corresponding style number set in the worldspawn entity. Equivalent to setting “style” “N” on a light entity (see Appendix G: Lightstyles).

http://q3map2.everyonelookbusy.net/shader_manual/ch3.htm#lightstyle


(C) #5

Hi there Pazur…

I used it too: q3map_lightStyle, but i noticed that many (i mean really many) shaders got duplicated and changed by q3map2 to create the lighting-effect…
For example, if Your flickering-light “touches” a shader named A, and You use shader-A all over Your map, the compiler will create a duplicate shader for every brushside that has shader-A on it… even if that brushside is a million miles from the flashing-light…
The effect was cool though… just what i wanted (like Your lightning-flash)…

I now used decal-shaders to produce the same effects for my torches, and they use considerable less resources. (You know, the decal-shaders with polygonOffset and sort decal in them)
The blending is a bit different now, because the lightmap is not changed by the decal-shaders, so i had to fine-tune the rgbGen values in my shaders so the flickering torch-lights are not too bright.


(pazur) #6

The idea with decals is cool and I bet it works really well with torches. I think RTCW had dlights at torches… and some kind of decal for smoke on the wall.

http://tramdesign.planetwolfenstein.gamespy.com/tutorials/tut_lightning.html <- tutorial using dlight (lightning bolt)


(C) #7

I bet it works really well with torches
…It does, if the light is just shining on some simple geometry… (like a flat wall or floor)
If the surrounding geometry is too complicated, it is undoable…

A real dynamic-light looks better but it is such an FPS-killer…
and the lightstyle shaders can create an uncompilable map (like i once had, with a bounce 10 light-compile… q3map2 produced that 800+KB shader-file, and it seemed too much to handle for the compiler…)