Page 1 of 1

Light emitting surfaces

Posted: Sat Jul 09, 2005 9:07 am
by ganjanoof
Hello everyone,

This is one of my first posts in this very forum :)

I could not find an answer to this question on my fellow french mapping forums.

Here it is : I designed a nice light emitting window texture that works perfectly... except it won't diffuse light in a single direction.

Let's say I make 4 windows in the walls of a square house. 3 of them will cast light but the fourth won't. Actually, it seems to be a shadow issue, 'cause from a far distance, my windows just look nice. Narrowing them will let the player notice there is no light diffuse around them (exterior wall, ground).

Any clue about this ?

Window's shader :

Code: Select all

textures/vineyard/test_light_window
{
	qer_editorimage textures/vineyard/light_frame.tga
	qer_keyword utility
	qer_keyword window
	surfaceparm glass
	q3map_surfacelight 1000
	// light 1
	// test light
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/vineyard/light_frame.tga
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
	{
		map textures/vineyard/light_blend.tga
		blendfunc GL_ONE GL_ONE
	}
}
:arrow: a clean copy of an original shader.

Posted: Sat Jul 09, 2005 6:28 pm
by lizardkid
Well light emitting windows are simply surfaces that q3 puts a bunch of point lights on, you could recreate the same effect in the editor.

But if the shader works once it must be some sort of structural problem, something blocking the light.

if you put these windows in five spots will the fifth work? Or if you rearrange the other four will that same one that doesn't work now not work?

Welcome to .map 8-)

Posted: Sat Jul 09, 2005 8:59 pm
by ganjanoof
ty :)

Well, thinking a bit about this... it seems like it does not diffuse light the side where shadows are cast...

My example of four walls was actually referring to the four cardinal points (E,S,W,N).

My (early) conclusion about this is that light emitting surfaces follow the behaviour imposed by sundirection. So the side that is considered to be shadowed by sundirection remains dark. I suppose the walls around the windows do cast shadows around it, so I can't see the light beam reflecting on the outside textures like walls and ground... This sux a bit as I need 2 different light intensities. I cannot use only the ambientlight so atm I'm quite stuck on this.

If someone is willing to test this I can provide a link on a test map.

Hope I'm not just reaching a moh engine limitation...

ty anyway :)

PS : I like bunny :mrgreen: but 2nd part of your sig... well I can't tell :shock:

Posted: Sun Jul 10, 2005 1:07 pm
by ganjanoof
I reproduced the desired effect by adding point lights as you suggested.

Thanks a lot.

Posted: Mon Jul 11, 2005 8:48 am
by bdbodger
Another cool effect is the dust beam from lights or windows like dust caught in a ray of sunlight . I seen a tut for it but not sure where right now either here or at tmt .

Posted: Thu Jul 14, 2005 10:53 am
by ganjanoof
Thx.

To remove shadows, someone suggested me to use -notrace / nosurfshadows... what I did. Actually it works, but it seems that my sunlight does not work anymore (my map seems only lighted by ambientlight).

Is it correct or is there something I don't understand ?