Page 1 of 1

light+func_rotating issue/discovery

Posted: Sun Jul 05, 2009 6:13 pm
by monaster
Found out something probably interesting depending on what you guys can make out of it:
If you make a small test map with only one room and a floating box made up of four brushes (not really floating just make it in a way that it doesn't touch any of the room's walls) textured with a grate texture that has a shader like this:

Code: Select all

textures/bla/window011 
{ 
	qer_editorimage textures/bla/window011.tga 
	surfaceparm trans 
	surfaceparm alphashadow
	surfaceparm playerclip 
	surfaceparm nonsolid 
	cull none 
	nopicmip 
	
	{ 
		map textures/bla/window011.tga 
		blendFunc GL_ONE GL_ZERO 
		alphaFunc GE128 
		depthWrite 
		rgbGen identity
	} 
	{  
		map $lightmap
		rgbGen identity 
		blendFunc GL_DST_COLOR GL_ZERO 
		depthFunc equal 
	} 
} 
This guarantees that you can look through this "window".
Only the inner side of this box is textured with this window texture, the rest is caulked.

If you now place a light entity (blue color, just to make it more obvious) inside this window box and compile the map inside GTKRadiant 1.5.0. with BSP -meta, -vis, -light -fast -filter -super 2 -bounce 8 , you'll get this:
Image
As you can see, only the box is visible, no more light is emitted so the room's walls stay black. (as to be seen in the lower left corner of that screenshot)

Now for the interesting part: if you take this map and convert the box into a func_rotating and then compile again, then suddenly the whole room is lit including the walls as you can see at the second picture. (again look at the lower left corner)
Image

Both test maps had a light entity with a radius of 64, therefore large enough to lit the whole room if there wasn't any box at all; but obviously the first (rigid) box arrangement could hinder light to some extent whereas the rotating box didn't block any.

Conclusion: Do whatever you want with that knowledge, perhaps even flame me if I brought up a question that is nothing more than the result of my dumb mapping, shader scripting or compiling. In either case I'm interested to know about it.

[EDIT: Added screenshots.]

Re: light+func_rotating issue/discovery

Posted: Sun Jul 05, 2009 9:44 pm
by Hipshot
Entities are "open".

Re: light+func_rotating issue/discovery

Posted: Sun Jul 05, 2009 10:02 pm
by monaster
That makes things clear, thanks, Hipshot!

Re: light+func_rotating issue/discovery

Posted: Mon Jul 06, 2009 3:41 am
by Hipshot
If you place a light behind a door, the light will go through it and also lit the door.
If you don't want this to happen I guess you can just put it as a shadow caster. With doors, having a lightmap edge when the door opens would probably look pretty bad in most cases.