search lights - light styles ?


(smurkin) #1

First post in this partciular forum…so here goes…

Could anyone point me to the know how on how to make search lights ? …I recall the technique being used in rtcw in at least one level (towers, machineguns & a pound with a truck iirc).

I actually want to use the technique for quake 3…& I’m bettin the all yogic q3map2 will let me do this with quake for my remake of LMCTF docks…I think I can feel a styled light coming on :)…

Any advice greatly appreciated

Ta Smurkin


(Mark.C) #2

Drakir has a prefab of one on his website, you could look at that and see how he made it :slight_smile:


(MindLink) #3

There are several methods you can use to do searchlights.
First one (that only works on a single flat surface though) is to do a brush out of nodraw and put a decal shader searchlight texture on top if it and make that a script_mover, moving it around on your flat surface.
Second one (working on arbitrary surfaces) would be to use q3map2’s _decal projection stuff to project a wide decal shader (lets say 512 x 64) onto the ground, having a single small spotlight in the middle and use the tc_mod stuff to move the spotlight around. That way the spotlight will be able to “run over” boxes and cover and stuff like that.
Both methods will NOT illuminate models in any way though, so a player standing in the center of the spotlight wills till be dark.
A third method I can think of is to check if it’s possible to move dlights around. Don’t know if this will work though. That would resolve the problem of models not being illuminated but would cost some processing power (but you’d be free to move that anywhere you want then). Maybe someone a little more into the dlight stuff can help you there :slight_smile:


(ratty redemption) #4

although I`m not sure if they can be moved, the new q3map2 alphamod blends, allow us to quickly make fading beams of light of any length, amd they can be func_grouped now, so they might work as script_movers.

eg, a cone mesh with small alphamod volume brushes covering the verts at the target end of the cone, would result in a very smooth linear fade.

and we don`t need to have embedded alpha channels in the tex any longer to make the beams, just a shader with…

alphagen vertex // or rgbgen vertex
blendfunc blend // or blendfunc gl_src_alpha gl_one

on any shader stage we want affected by the alphamods… some other alpha (transparency) blendfuncs with also work, but not blendfunc filter or add on it`s own.

the advanced of blendfunc gl_src_alpha gl_one, is it contains transparency and add, so will make the beam brighter then just blend, so might be better for strong light beams.

blendfunc blend is more subtle, and would probably be better for light beams cast from daylight windows, like in churches or from dim overhead lights.


(smurkin) #5

Ratty, Mindlink, fellers thanks, that all sounds fantastic. Only one fly in the ointment…I’m not a shader guru & while I understand the basics of your suggestions, I think I need to focus on the simplest approach or I’m not going to get this done :wink: .

The setting is a dock platform surrounded by water…its dark (night) its dead flat & the beam will probably move back & forward over the flat surface. I tried decal projectors, but never got on with them.

So I’m thinking

[quote] First one (that only works on a single flat surface though) is to do a brush out of nodraw and put a decal shader searchlight texture on top if it and make that a script_mover, moving it around on your flat surface.

[quote]

A script mover…thats like a train I guess.

Decal shader searchlight texture…this I need to make ? Simply a round light area with an alpha channel mask with:

textures/smurkin/searchlight
{

qer_editorimage textures/smurkin/searchlight.tga
surfaceparm trans	

// surfaceparm alphashadow
surfaceparm nomarks
polygonOffset
cull none

   {
	map textures/smurkin/searchlight.tga
	blendFunc GL_ONE GL_ZERO
	alphaFunc GE128
	depthWrite
	rgbGen identity
   }
   {
	map $lightmap
	rgbGen identity
	blendFunc filter
	depthFunc equal
   }

}

(is this what you mean by a decal shader ??) or can I do it with .jpegs ? Any idea if this will cast onto water (it need not) ???

As for the model…I’ll probably make my own…something dead simple.

Thanks again.


(MindLink) #6

Ok try the following for your spotlight picture : make a 128x128 (or 256x256, whatever you want) sized shader, fill it completely black, draw a white circle in the middle (keep 16-32 pixels distance from the edges) and gaussian blur that by 16-32 units (depending on your distance from the edge) to get the edges smooth. Don’t do an alpha channel. Now save that as searchlight.tga (or .jpg, doesn’t really matter) and try the following shader :

textures/smurkin/searchlight
{
qer_editorimage textures/smurkin/searchlight.tga
surfaceparm nomarks
surfaceparm trans
polygonOffset

{
map textures/smurkin/searchlight.tga
blendFunc add
rgbGen identity
}
}

Ok. Now this will be a little bright to start off with, so gradually edit your searchlight.tga and decrease brightness step by step till you get satisfactory bright results ingame. That depends strongly on the brightness of your area beforehand. This will NOT work good in an area where there’s virtually no light since everything will become pretty grey. But if there’s a little light to start off with this should work pretty good.
Just put that on top of your train brush (yeah forget those script_movers, forgot you’re working in q3a :slight_smile: ) and put the brush so that the spotlight stuff is at the same height as your ground.
Cheers :slight_smile:


(ratty redemption) #7

edit: MindLink beat me to posting my reply, but I agree with everything he said :slight_smile:


(MindLink) #8

btw the volume alphamods and blends can’t be used since they’re compiler only shaders. :slight_smile:


(SiliconSlick) #9

You could look at Storm Rising’s “ammodepot” map.
It has some nice searchlights.

The source and playable binary are available at RTCWfiles.com.

SiliconSlick


(ratty redemption) #10

@MindLink, understood and thanx for clarifying that.

I still recommend mappers trying them for static light beams, and they really aren`t difficult to use... I set up some alphamod volume brushes on my curved waterfall test and it only took me a few mins, as opposed to several hours previously to get the same results using alphamaps (bitmaps) ...and the new blends are really versatile :)

(smurkin) #11

Thanks fellers…I’ll let you know how I get on :slight_smile: