feature request.. compile time light blocking.. not vis...


(Hewster) #1

Hi Ydnar,

This is what I’d like to be able to do…

Ok imagine the scene… a building is in full bright sunlight, with 2 small
windows and an open door…

In real life, the inside of the building would bet fairly well it, due to
light bouncing in through the windows and door…

If I compile a map like this, without any bounce, the inside is
pretty much pitch black… I’m sure most mappers know what I’m
talking about… so the easy way to get some light in there is
to add a low intensity point light or two, with a low fade (0.2 - 0.4)…
and this does the trick… but…
the light will also escape out of the windows and door… and in some
cases you till see this light hitting other surfaces outside of the building.
I have tried making spot lights with large radiuses pointing into the room,
and this way does work, although its not perfect…

What if we had 3 shaders:
allow_light_in (to the brush)
allow_light_out (of the brush)
stop_light

for the compilation only, ie so it doesn’t effect vis ect in-game,
just the lightmap creation.

A brush could then be made that sits in windows / doorways where the
outside face has ‘allow_light_in’, the inside face has ‘allow_light_out’
and the other edges can have ‘stop_light’ …

Is this possible ? or do i not understand how the lighting compilation works ?

Cheers

Hewster


(Hewster) #2

Update…

I’ve had a serious play with trying to get a way to get more realistic lighting
through a window into an otherwise unlit room, while not letting any other
ambient light out, and I wanted player to be able to move through the window
spaces, i.e. an open window, or just a hole in the wall.

ok, I created this shader:

textures/hew_fx/block_light
{
qer_trans 0.3
surfaceparm nodraw
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm nolightmap
{
map textures/hew_fx/blank.tga
alphaFunc GE128
depthWrite
}
}

when applied to a structural brush, it stops light going through, while at the same time
allows a player to walk through it.

I placed this outside a window:
http://www.deevickery.btinternet.co.uk/ww/forum_stuff/q3map2/lighting/block.jpg

I then, rather than make a point light, created a transparent light emitting shader:

textures/hew_fx/blank_emit10k
{
qer_trans 0.5
q3map_lightimage textures/hew_fx/blank_light2.tga
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm nolightmap
q3map_surfacelight 10000
cull none
{
map textures/hew_fx/blank.tga
blendFunc blend
rgbgen vertex
}
}

blank_light2.tga is a very dark, slightly yellow texture
blank.tga is a 100% transparent image

and placed it in the window space, behind the light blocking texture
pointing slightly downward:
http://www.deevickery.btinternet.co.uk/ww/forum_stuff/q3map2/lighting/emit.jpg

and I get these results:
http://www.deevickery.btinternet.co.uk/ww/forum_stuff/q3map2/lighting/shot0006.jpg
http://www.deevickery.btinternet.co.uk/ww/forum_stuff/q3map2/lighting/shot0004.jpg

I’m happy, cos using this method I can illuminate inside a building, while not allowing light back out,
and any window space is accessible by players…

However it would be really nice if the light_blocking shader didn’t have to be on a structural brush.
for obvious reasons…

Maybe I’m going about this the wrong way, but I cannot think of another way of doing it, so if there is a way to enable such a ‘light blocking’
shader to be applied to a detail brush I would be a very happy bunny.

Hewster


(ydnar) #3

Hm, that’s not a bad idea.

I mean, automated, that is…

A special shader that would collect light from one side and re-emit it on the other side as a surface light, while blocking the passage of light through it.

You can sort of do it now, using radiosity and q3map_bounce N.

y


(Hewster) #4

Indeed , in an ideal scenario, this is the conclusion we came to :slight_smile:
Also with a way to scale the amount of light emmited ?
and maybe, for the tweaking freaks, an angle setting for the emitted
light?

Thanx

Hewster


(Karloff) #5

Indeed , in an ideal scenario, this is the conclusion we came to :slight_smile:
Also with a way to scale the amount of light emmited ?
and maybe, for the tweaking freaks, an angle setting for the emitted
light?

Thanx

Hewster

Don’t know whether this hack still works with q3map2, but I have used it successfully before:

textures/whatever/sunlight
{
	qer_editorimage textures/whatever/sunlight.tga	
	surfaceparm nolightmap
	surfaceparm nonsolid 
	surfaceparm sky
	skyparms - - -
	q3map_sun 0.42 0.47 0.64 100 135 30 
	q3map_surfacelight 200
}

without surfaceparm trans, such a brush should block light. You can even throw a nice window light square on the floor. (not sure about how multiple suns are handled by q3map2).
beat me if it’s dirty :wink:
//kf.


(BoltyBoy) #6

Just want to make sure my voice of support is heard on this one…

This would be a truly evolutionary step for the whole of mankind and will surely benefit the whole of humanity in a way that we may never fully appreciate.

In other words…please please Ydnar, if you can find a way to make this work I would consturct a monument in your honour…it’d prob be a beer monument.