Page 1 of 1

Flickering lights

Posted: Sat Jan 10, 2004 1:00 am
by Axion
Is it possible to make lights flicker intermittently?

Posted: Sat Jan 10, 2004 2:01 am
by omniscient
go to wackos mohaa trashbin and check out the torches, look at the shader and stuff to see how its done.

Posted: Sat Jan 10, 2004 2:24 am
by Random
Sad part is there are many other games based on the same engine that have dynamic lights that can flicker. BUt in mohaa you need to do it with scripting.

Posted: Sat Jan 10, 2004 2:31 am
by omniscient
very sad but very true. u have a lot more freedom in mohaa editing than in any other game ive seen, the downside to that is the easy stuff is complicated.

Posted: Sat Jan 10, 2004 5:38 am
by bdbodger
Have a look at this post

/forum/viewtopic.php?t=5396

Posted: Sat Jan 10, 2004 6:32 am
by omniscient
boger hes looking for a flickering light. its says at the top that this is for a pulsating light, not a flickering one. cool find though.

Posted: Sat Jan 10, 2004 7:00 am
by bdbodger
I guese you are right my mistake I just remember that post so I posted the link .

Posted: Sat Jan 10, 2004 2:04 pm
by wacko
http://dynamic4.gamespy.com/~map/mohaa/ ... flickering and
viewtopic.php?t=1721&start=0&postdays=0 ... highlight=
was probably the same topic.
the result was that this would have to be scripted and that these lights don't care much about walls and their ability to stop light :?

so, axion, what do u want to use these lights for? the torches at the recyclingbin do not flicker, but u won'T get light spots at the backside of the walls. scripted lights can flicker but they go through walls...

Posted: Sat Jan 10, 2004 6:06 pm
by Axion
Well, I'm working on an objective map for a Shipping Facility/Storage House, and one the objectives is for the Allies to make their way underground to the basement where the facilities' power generator is housed and destroy it. I was seeing if it was possible to make some of the lights in the facility flicker or shut off after the generator was destroyed. So far, it looks like it's going to be more trouble than it's worth, but I wouldn't mind placing a few broken lights around for atmospehere.

And thanks to everybody who has replied, you've been very helpful!

Posted: Sat Jan 10, 2004 7:41 pm
by wacko
shouldn't be too difficult to set some flickering lights in your factory building.
jv's example map is good to start with and it includes everything u'll need. You will just have to keep in mind that these lights are visible on both sides of the wall they are attached. So u will probably just place them on walls where just one side can be seen.

Dynamic light

Posted: Sat Jan 10, 2004 9:24 pm
by tltrude
While dynamic lights add cool effects to your map, they also lower the frame rate badly. I added eight small flashing dynamic lights to Wacko's UFO map and saw that the FPS drops by about 20 points whenever they are on (50 down to 30 range).

So, don't use dynamic lights to light your map, and only use them for effects sparingly.

Posted: Sat Jan 10, 2004 11:29 pm
by Random
Ok how about this, and this took me a while to come up with. Lets say the light doesnt flicker but the corona you put around the light does?

Try this. Edit the shader that is used for the corona.

Code: Select all

corona_reg
{
	qer_editorimage textures/sprites/corona_reg.tga
	deformVertexes lightglow
	cull none
	{
		animmap 4 textures/sprites/corona_reg.tga, textures/sprites/corona_reg.tga, textures/sprites/blankcorona_reg.tga
		blendfunc add
	}
}
This would require a secondary texture named here as blankcorona.tga. Now the light would be on for a bit then off, and repeat. You could play around abit with it to create a more elaborate flickering effect.

If you need to know more just ask and i will see what i can do.

Random

Posted: Sun Jan 11, 2004 1:14 am
by Axion
Random wrote: This would require a secondary texture named here as blankcorona.tga. Now the light would be on for a bit then off, and repeat. You could play around abit with it to create a more elaborate flickering effect.

If you need to know more just ask and i will see what i can do.
I'm afraid that I don't understand this part. Do you mean that I need to create a custom texture and rename ir ro blankcorona, or can I just use any texture?

Posted: Sun Jan 11, 2004 2:27 am
by Random
Yes you will have to create a custom texture and you can use any names you like. Just make sure the shaders are correct.

What i should have done is explain more how a flickering light is possible without a giant fps hit. That shader i provided wouldnt work anyways but i was just tryin to nudge you in that direction.

Also you may try to set one of the textures to emit light in the shader and the other one not. Not to good for creating shadow but again its an option.

Posted: Sun Jan 11, 2004 2:46 am
by bdbodger
The light from a light emitting texture is calculated in the light stage of compileing and it takes a lot longer to compile . I think the corona or the dynamic lights with a small radius are the only options . I made a traffic light as a test once and used about 16 small dynamic lights for the signal and walk lights I didn't notice a big drop in fps but it was a small test map .
You can download it and have a look if you want the pak has the map in it .

http://members.shaw.ca/bdbodger/bdb_traffic_light.pk3