Light Boundaries


(Mr_Tickles) #1

I’m having a little problem with my light, it keeps spilling through walls:

1:

2:

3:

4:

5:

1: You can quite clearly see the red light from the only room which has it, 2:.
In, 2: there’s other light apart from the red in there.
3: That’s just a mess.
4: Extra light peeping through the rafters coming from the moon.
5: Light around door coming from the other side of it and towards the left of the screenshot, light coming out through the wall.

Everything is tightly fitted together so there shouldn’t be any leaks or brushes not touching.
Tha ambience key is not on at all, if you see extra ambient light outside, it’s coming from the sky.

I looked in the common textures to see if there was anything and there wasn’t.
Any ideas?

Thanks


(MadJack) #2

How thick are you brushes? I found that 32 units is usually thick enough to stop light from leaking in/out/around.

EDIT: There’s probably different ways/thickness used by most mappers but 32 units is what I use and doesn’t mean in any way a set way to do things though :slight_smile:


(buttrot) #3

there are a few posts on this subject try the search.I had this prob and if i remember correctly the solution for me was to make walls of house a func_group and set a _lightmapscale value of .5 or .25 or .125 or … depending on the leakyness


(Mr_Tickles) #4

Thanks for the replys.

I’m really not about to alter the thickness of everything, I’d like to keep hold of what sanity I have left. But it’s worth noting for future, thanks.

Sounds good, I’ll have a look and see what I find on the lightmapscale, thanks :slight_smile:


(Ifurita) #5

you can func_group a bunch of brushes together, where you are getting light leakage and give them a key of _lightmapscale .1 or something.


(ratty redemption) #6

you can also use a sun blocking nodraw tex, which can be any thickness, and can be hidden inside other detail brushes, like walls.

eg

textures/_ratty_terrain/light_block
{
	qer_editorimage textures/_ratty_terrain/nodraw.tga
	q3map_nolightmap
	surfaceparm nonsolid
	surfaceparm nomarks
	{
		map $whiteimage
		alphagen const 0
		alphafunc gt0
	}
}

it`s tris will still show up ingame with r_showtris, but players can walk through them (if their not inside solid brushes) and they are invisible.

edit: I didnt wait for all your pics to dl on my 56k, before posting so Ive just noticed it looks like all light leaks are from entity lights, which I haven`t tested with the sun blocking tex, although someone here probably has.


(Mr_Tickles) #7

Thanks Ratty, I’ll try that aswell :slight_smile:

EDIT: I’ve just realised that if i put the above in the common shader file I may not notice any difference… because: I’ve tryed to add a custom texture to map and it has only been showing up in radiant and not in game. I have no idea why. I’ve put it in etmain extures\mr_tickles. It’s in Jpeg format and 27.8 K. Thing is, if I create your no_light texture with the shader, it may show up in radiant, but would have no effect in game. Probably best to get this sorted first before I move on. I’m probably just being dull.


(ratty redemption) #8

cool, and please tell us how you get on with this :slight_smile:


(Mr_Tickles) #9

I will don’t worry.
Just thought i’d bump this seen as though your online at the moment so that you can read my edit :slight_smile:


(ratty redemption) #10

sorry, I missed this earlier, and the only thing I can think of is are you saving the jpg in standard encoding, and not progressive encoding, iirc, the q3 engine games don`t like progressive jpg, although I might be wrong.


(Mr_Tickles) #11

Ok, I’ll try different formats, see if that works.
Thanks


(MadJack) #12

Use baseline for jpeg, Q3 will choke on progressive.


(Mr_Tickles) #13

Yep, just had a read around, the dimensions of them also have to be: 2^x X 2^y and should really be saved in TGA format to get fewer errors.


(Mr_Tickles) #14

Ok, I’ve tried it and had mixed results.
Firstly I put it into my current map - Worked great (compare it with 3: above):

Except that it gave a funny patchy effect of the light on the walls in the red room:


Any more ideas? :???:

Oh, and I tried it in a test map (single room with a light, in a skybox) with the “no_light” brushes buried deeply into the walls, floor and ceiling. It just gave the effect of me texturing the inside faces with caulk, the outside ones were fine. I also put it over where the door was and yes, it does appear invisible and does let you walk through it.


(MadJack) #15

Looks to me like casted shadows…


(ratty redemption) #16

hmm, well I havent tested this myself with light ents, but I agree, those shadows are weird, I assume you dont get them when the light blocking brushes aren`t there? …maybe your should ask ydnar about this, I think Hewster was asking him a while back about blocking sun light leaking into buildings and entity lights leaking outside buildings.

we definitely need a system that works with all light leaks.

and can you post a pic of the caulk effect you were getting with the buried light blockers? and where in your map are they now, if you found burying them didn`t work? …also are you painting all sides of the blockers with the same tex, ie not caulk or common/nodraw on the other faces?


(Mr_Tickles) #17

MadJack, there are no other objects in the room, you’ve got the whole view of the room from the pics already posted and there’s nothing that can possibly cast those kinds of shadows :slight_smile:

Here are some screenshots:






Hope this helps…

The blocker brushes are entirely covered with the “light_boundary” texure, do you think they shouldn’t be?

I used absolutely no caulk on the test map, neither did I use the no_draw texture.
However there is a “Shader not found” texure on the outside of the skybox :slight_smile:

I also had a few textures around the door disappear in the red light room, just to let you know that it wasn’t solely on the testmap.

Quick question, the line in your code :
qer_editorimage textures/_ratty_terrain/nodraw.tga
refers to the image you created for the editor right?
and… your first line:
textures/_ratty_terrain/light_block
refers to what? I have that pointing to the image that the editor uses again… does that make much of a difference?
Excuse me for being completely stupid with this :), I haven’t had much time to look at shaders and their commands yet, mainly because I don’t know how you guys know what the commands are, or how you find out about them and I have exams coming up in under two weeks.

I’ve also searched for this topic and found some useful stuff, as Buttrott and Ifurita have said, mainly setting the func_group a key: _lightmapscale Value: 0.75, 0.5 or 0.3.
I set mine to 0.3 to make sure I got rid of all the leaks, the map compiled, but wouldn’t load in ET. I had this error:
SV_SetBrushModel: Null
Yes, I did use /sv_pure 0, twice to make sure, and I have no idea what Models have to do with thiis.
I selected all my brushes in the house, right clicked and chose func_group, that’s right, right? Or do you have to make new brushes buried in the walls with this function?

Why doesn’t the compiler realize that light simply follows the exact same line of sight as a players vision?

I’ll PM ydnar and ask him to have a look at this thread seen as though trying to expain all this in a message is a bit dull especially as it’s already here. :slight_smile:

P.S. I’m going to sleep now :zzz:


(ydnar) #18

Func group the building’s brushes and add “_lightmapscale” “0.25” or lower. Use a value of “0.125” if that doesn’t correct the problem.

Also, make sure you’re using the latest release of Q3Map2. Certain versions had problems with shadow acne as you found in the red-lit room.

What compile options are you using in the -light phase?

Using a non-drawing shadow casting shader isn’t necessary to fix your problem. If the brushes are solid, opaque, caulked or textured, they will block light. What you need to ensure is that in order to block sun/sky light, the lightmap sample size is less than the thickness of the brushes in question. So if they are 8 units thick, you need to use at least _lightmapscale 0.5, preferably 0.25 to reduce lightmap sample size from 16 to 8 or 4.

y


(MadJack) #19

As usual, y’s post is very enlightening :smiley:


(Mr_Tickles) #20


:clap::notworthy::D:rocker2::banana:
It worked like a dream on the test map, thanks!

Sorry to waste your time :bored:


This is the problem with my main map now :banghead:

…the map compiled, but wouldn’t load in ET. I had this error:
SV_SetBrushModel: Null
Yes, I did use /sv_pure 0, twice to make sure, and I have no idea what Models have to do with this.
It happened after I did the _lightmapscale alteration.
Any one know how to correct this?

Yep, I used the latest q3map2.

Edit:

Ok, don’t worry, I did a search for it and it said that there is an origin brush without it’s door or something. I func_grouped the doors aswell, I guess this removed the func_rotating, oops. Just going to correct that and add a caulk lightmap instead. :slight_smile: