Lights and lighting Created 16 years ago2008-01-02 07:16:50 UTC by WhiteRAZOR WhiteRAZOR

Created 16 years ago2008-01-02 07:16:50 UTC by WhiteRAZOR WhiteRAZOR

Posted 16 years ago2008-01-02 07:16:50 UTC Post #242280
Just a few questions about lights, if anybody can help that'll be appreciated.

1) Skybox.

How do you make the place look more mid day looking? I've asked this in another string in this forum but I didn't really understand it. I just used the skybox texture for the 'walls' and 'ceiling' of my map, and that seems to produce a sky that looks like it's going to rain.

2) 'Natural' lighting.

Is the lighting just bad in Source that shadows don't really get produced where they're physically supposed to? I don't seem to be getting much shadows where I think they're meant to be... like when I have the same textures near each other, you can bearly see they're different objects. I haven't used any light entities, I've only used the skybox texture that seems to make everything light up... is that right?

3) Light textures.

I'm using Hammer (Counter-Strike: Source) and I want to place lights on the ceiling. I want to use the same ones as what's in the cs_office map... are these decals? I tried placing some down but it came up with some huge thing that I have no idea what it is... it's like when I place the decal, it places down like a wall texture. Hm

4) Light entities.

Is there a way to make one room have different lighting than the next? I want to make a room pitch black, while other rooms lit like you have the light on... how do I do that?

Sorry to ask many questions, any help or links will be much appreciated.

Thanks in advance.
Posted 16 years ago2008-01-02 09:32:38 UTC Post #242285
1) "a sky that looks like it's going to rain." You mean the default skybox texture. You can change it by following these steps and select another sky texture form the sky list.

2) That sounds to me like your lighting isn't calculated correctly yet, leading to a map with "fullbright" on. With this, you will have no shadows at all and all rooms are lit. Look for error in your compile log, that may lead to fullbright on.

3) The lights from office are props and you can put them in as prop_static. But with the prop only, you will just have the lamp not the light. You'd need to add a light entity close to the lamp entity. Tips on lighting.

4) Like Highlander said.
Posted 16 years ago2008-01-02 23:00:43 UTC Post #242355
1) Thanks guys, I think I understand that now... for some reason I still feel I'm limited to the number of textures... I can't find one that looks nice. Nevermind.

2) Yeah, I'm not sure what fullbright is. I remember using it in Quake (original) so it's easier to see stuff, so I guess I understand what you mean by if it's on. How do I turn it off? I'll post my log:
** Executing...
** Command: "f:gamessteamsteamappsreddragon03sourcesdkbinep1binvbsp.exe"
** Parameters: -game "f:gamessteamsteamappsreddragon03counter-strike sourcecstrike" "C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32"

Valve Software - vbsp.exe (Dec 11 2006)
2 threads
materialPath: f:gamessteamsteamappsreddragon03counter-strike sourcecstrikematerials
Loading C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32.vmf
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (2)
** leaked **
Entity func_door_rotating (-779.50 -1215.55 -722.00) leaked!
Processing areas...done (0)
Building Faces...done (0)
Chop Details...done (0)
Find Visible Detail Sides...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (3)
Creating default cubemaps for env_cubemap using skybox materials:
skybox/sky_day02_02*.vmt
Run buildcubemaps in the engine to get the correct cube maps.

No such variable "$hdrbasetexture" for material "skybox/sky_day02_02rt"
Can't load skybox file skybox/sky_day02_02 to build the default cubemap!
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (1) (919842 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 4772 texinfos to 3135
Reduced 24 texdatas to 21 (550 bytes to 454)
Writing C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32.bsp
10 seconds elapsed

** Executing...
** Command: "f:gamessteamsteamappsreddragon03sourcesdkbinep1binvvis.exe"
** Parameters: -game "f:gamessteamsteamappsreddragon03counter-strike sourcecstrike" "C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32"

Valve Software - vvis.exe (Nov 8 2007)
2 threads
reading c:documents and settingswhite razormy documentsothersource maps32.bsp
reading c:documents and settingswhite razormy documentsothersource maps32.prt
LoadPortals: couldn't read c:documents and settingswhite razormy documentsothersource maps32.prt

** Executing...
** Command: "f:gamessteamsteamappsreddragon03sourcesdkbinep1binvrad.exe"
** Parameters: -game "f:gamessteamsteamappsreddragon03counter-strike sourcecstrike" "C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32"

Valve Software - vrad.exe SSE (Nov 8 2007)
--- Radiosity Simulator --
2 threads
[Reading texlights from 'lights.rad']
[1 texlights parsed from 'lights.rad']

Loading c:documents and settingswhite razormy documentsothersource maps32.bsp
No vis information, direct lighting only.
18848 faces
54 degenerate faces
1405210 square feet [202350320.00 square inches]
0 displacements
0 square feet [0.00 square inches]
4 direct lights
BuildFacelights: 0...1...2...3...4...5...6...7...8...9...10 (141)
Build Patch/Sample Hash Table(s).....Done<0.0875 sec>
FinalLightFace: 0...1...2...3...4...5...6...7...8...9...10 (2)
FinalLightFace Done
0 of 0 (0% of) surface lights went in leaf ambient cubes.
ComputePerLeafAmbientLighting: 0...1...2...3...4...5...6...7...8...9...10
Ready to Finish

Object names Objects/Maxobjs Memory / Maxmem Fullness
---------- ------------- ------------- ------
models 100/1024 4800/49152 ( 9.8%)
brushes 2333/8192 27996/98304 (28.5%)
brushsides 15883/65536 127064/524288 (24.2%)
planes 8460/65536 169200/1310720 (12.9%)
vertexes 28863/65536 346356/786432 (44.0%)
nodes 12404/65536 396928/2097152 (18.9%)
texinfos 3135/12288 225720/884736 (25.5%)
texdata 21/2048 672/65536 ( 1.0%)
dispinfos 0/0 0/0 ( 0.0%)
disp_verts 0/0 0/0 ( 0.0%)
disp_tris 0/0 0/0 ( 0.0%)
disp_lmsamples 0/0 0/0 ( 0.0%)
faces 18848/65536 1055488/3670016 (28.8%)
hdr faces 0/65536 0/3670016 ( 0.0%)
origfaces 9546/65536 534576/3670016 (14.6%)
leaves 12505/65536 400160/2097152 (19.1%)
leaffaces 21144/65536 42288/131072 (32.3%)
leafbrushes 7885/65536 15770/131072 (12.0%)
areas 2/256 16/2048 ( 0.8%)
surfedges 131096/512000 524384/2048000 (25.6%)
edges 74292/256000 297168/1024000 (29.0%)
LDR worldlights 4/8192 352/720896 ( 0.0%)
HDR worldlights 0/8192 0/720896 ( 0.0%)
waterstrips 1772/32768 17720/327680 ( 5.4%)
waterverts 0/65536 0/786432 ( 0.0%)
waterindices 30606/65536 61212/131072 (46.7%)
cubemapsamples 0/1024 0/16384 ( 0.0%)
overlays 0/512 0/180224 ( 0.0%)
LDR lightdata [variable] 4820644/0 ( 0.0%)
HDR lightdata [variable] 0/0 ( 0.0%)
visdata [variable] 0/16777216 ( 0.0%)
entdata [variable] 196639/393216 (50.0%)
LDR leaf ambient 12505/65536 300120/1572864 (19.1%)
HDR leaf ambient 0/65536 0/1572864 ( 0.0%)
occluders 0/0 0/0 ( 0.0%)
occluder polygons 0/0 0/0 ( 0.0%)
occluder vert ind 0/0 0/0 ( 0.0%)
detail props [variable] 1/12 ( 8.3%)
static props [variable] 1/264 ( 0.4%)
pakfile [variable] 20787/0 ( 0.0%)

Level flags = 0

Win32 Specific Data:
physics [variable] 919842/4194304 (21.9%)

Total Win32 BSP file data space used: 10505904 bytes

Total triangle count: 55098
Writing c:documents and settingswhite razormy documentsothersource maps32.bsp
2 minutes, 27 seconds elapsed

** Executing...
** Command: Copy File
** Parameters: "C:Documents and SettingsWhite RazorMy DocumentsOtherSource Maps32.bsp" "f:gamessteamsteamappsreddragon03garrysmodgarrysmodmaps2.bsp"
3) I followed the link you sent me R1Co, and added a static light prop with a spot light. That worked fine, but now my entire map is pitch black apart from where I placed those spot lights... Is fullbright turned off now?

4) Thanks Highlander, but I haven't done it yet. I'll try it soon.
Posted 16 years ago2008-01-02 23:35:30 UTC Post #242359
Are you sure you actually have light entites in your map? If there aren't any light entities or light-emitting textures in the map, RAD won't calculate any lighting, so the map will default to being fullbright (if you enter mat_fullbright 0 in the console, you'll get a pitch-black map). The skybox texture doesn't emit light by default because it's a special texture whose lighting can be manually changed with the light_environment entity, so keep that in mind.

I see RAD ran in the compile log but I don't remember if the compile simply skips it if there aren't any light entities in the map or if it just runs through the process and doesn't actually calculate anything. I may be wrong.
Posted 16 years ago2008-01-03 07:37:21 UTC Post #242427
Yes, you'd need a light_environment somewhere in the map to enable the global lighting.

And you have a leak:
** leaked **
Entity func_door_rotating (-779.50 -1215.55 -722.00) leaked!
That should be solved because as far as I understand the compile process, a leak prevents VVIS from being executed and without VIS RAD will use direct lighting only, like in your log:
No vis information, direct lighting only.
You know about leaks and pointfiles?
Posted 16 years ago2008-01-03 08:38:39 UTC Post #242432
This is all very confusing. I tried that pointfile thing and found a leak. I don't know how to fix it. I also put a "light_environment" or whatever it is in.

The vvis part of the compiling takes ages. I can't be bothered waiting for it now and I just go to task manager and end the process to stop it...

I'm lost. I have no idea what this leak thing means. I've read that article you linked me to R1Co.
Posted 16 years ago2008-01-03 09:30:42 UTC Post #242433
Leaks are either gaps in your map geometry (gaps between brushes - entities don't close gaps) or they are entities that are outside of your map - like a model that pierces a wall and can be seen from outside. Make sure that no model is outside and your world is sealed of by having all brushes next to each other. Gaps are sometimes hard to find but when you follow the red pointfile line you should be able to find it. There doesn't have to be any connections from the void into your map. Connections can happen through open gaps, entities or displacements - not through brushes. Well the article says it all. That way I learned it. :)

The VIS and RAD really take ages, when done completely. For testing purpose you might select "fast" on VIS and RAD. It's not 100% correct but it gives you a good idea of the lighting.
Posted 16 years ago2008-01-03 10:36:34 UTC Post #242435
Hm, it didn't seem to take this long before... Or does the lighting have a large influence on it?
Posted 16 years ago2008-01-03 10:51:51 UTC Post #242437
VVIS is skipped when you have leaks, so if you have a leak it's fast. ;) Controlling Geometry Visibility and Compile Times. Lighting impact on the compile process happens when VRAD runs.
Posted 16 years ago2008-01-03 11:01:14 UTC Post #242439
Oh. Yeah, that'll explain it. Because allll the time, I've placed a bunch of entities outside the map as my "pallet". So yeah, I've had leaks all the time, until now when I've sort of learnt what they are and fixed them.

Riiiiiight.....

Well, this kind of sucks now. It takes so long to compile :'(

I've read the link to the Wiki, but I want to ask... do leaks really matter?
Posted 16 years ago2008-01-03 11:32:20 UTC Post #242444
do leaks really matter?
If you ever want to publish your map, leaks matter. As I understand it, leaks will prevent VVIS from being run, this will lead to bad performance since all parts of your map will be drawn all the time. In addition lighting will be f***ed up. So the map will be totally crap. :)

Like I said, compile time can be reduced by using the fast VIS and RAD option. You may also skip VIS and RAD completely when you are not interested in lighting results and just want to see the geometry and stuff. Only the final compile run will need to be normal then.
Posted 16 years ago2008-01-03 11:50:33 UTC Post #242445
Sigh. I'm not sure if I have the patience to go through all that compiling time. I guess geometry is what really matters most in my case.

One question though - If I do apply lights, in which results in fullbright being turned off, do I have to put a light in every room to make it light up?
Posted 16 years ago2008-01-03 13:02:57 UTC Post #242451
When I shut off VIS and RAD my map gets compiled within seconds, even though it has a lot of geometry. I guess it's because I already turned the detailed geometry into func_detail objects. Those are ignored by VBSP.

If you have a light_enviroment the light will come through windows and doors aswell but the rooms might stay rather dark and it would be necessary to put additional lights into them.
Posted 16 years ago2008-01-03 13:28:17 UTC Post #242454
Using fast VIS and RAD is fine for test compiles, but a full compile is mandatory when creating a version for release. Your map will run slower, especially with a fast VIS compile, as VIS doesn't do proper visibility calculations on the map (hence the speed).

There are ways to speed up VIS. The most easiest is the use of the func_detail entity. Converting complex brush-based geometry to a func_detail will greatly assist VIS when it's performing its calculations.

Increased compile times can be caused by many things: large, open maps, lightmap grids, and, the most common of all, unoptimised maps. This is a great guide on how optimising Source maps: it gives a brief insight into how BSP (the Source map format) works and renders. It's nessecary to grasp even just a basic idea of this, as it'll give you a clearer indication as to what's causing problems down the track.
AJ AJGlorious Overlord
Posted 16 years ago2008-01-04 08:34:53 UTC Post #242566
Thanks Ant for the guide. I had a look, and realised how bad my map was! This is my first map I'm working on.

Yeah, I don't think I'll really bother with all that... it looks too hard.

My map is just a building to walk around in, I guess it doesn't need to be really great... I could probably even leave it fullbright, and skip the vvis process.

All my walls and stuff aren't func_detail either.

I guess all of these things are considered during the making of the map? I take it you guys change all your walls to func_detail as you go and fix up all the visleafs everytime you make a new room?
Posted 16 years ago2008-01-04 08:39:42 UTC Post #242567
Yah. Once you get an idea of how BSP works, you construct your areas with it in mind. You think about where the engine renders things and where it doesn't and so on.

For future maps, you'll really want to have VIS and RAD. Seriously. :P
AJ AJGlorious Overlord
Posted 16 years ago2008-01-04 08:44:26 UTC Post #242568
Does that mean when I put light entities down, I have to put them in like every single room to make sure they're all lit? If so, what type of entity do I put down?
Posted 16 years ago2008-01-04 09:19:13 UTC Post #242569
Well if you delete every light in your map, you will have fullbright on again, which will make unrealistic lghting but everything will be lit.
Posted 16 years ago2008-01-04 09:29:46 UTC Post #242570
Ok, quick outline of lighting:

light_environment - Lights up the entire map. Good for sunlight and moonlight and whatnot. Blocked by brushwork.

light - A simple light that sprays light in a 360 direction. Good for light bulb lighting.

light_spot - A more direct light. Good for spot lights. Can adjust the width of the spot to create a more open or closed light.

Those are the simplest ones to start off with.
AJ AJGlorious Overlord
Posted 16 years ago2008-01-04 09:39:32 UTC Post #242571
Hm okay, so I'm going guess I put a "light_environment" outside on my skybox, and in each room that doesn't get enough light, I guess I'll put a "light" on the ceiling or just in the middle of the room?

Sorry for all the questions and stuff. I really have no idea what I'm doing...
Posted 16 years ago2008-01-04 10:30:56 UTC Post #242574
This is where experimentation comes in. Fiddling around with position and brightness values will give you a good idea.
AJ AJGlorious Overlord
Posted 16 years ago2008-01-05 09:59:56 UTC Post #242642
Yeah, I think it's a bit late for me to start fixing things up. It's the first thing I've built and I accept the fact that it's going to be shit.

I think I might leave it. When I built it, I had a couple of practice runs with building walls and stuff, but never realsed how much more to it there is.

http://www.youtube.com/watch?v=reXt0JEfv5w

That's what I've done so far, and yeah, I haven't fixed up the visleafs and lights. No matter how many times I read that site you gave me, I still don't get it. As far as I can understand, I should just func_detail every single wall I build...

And I have to experiment with lights. As you can see in that clip, fullbright is on because I haven't done any lighting.

If there's any brief feedback you want to give, you're most welcome.

Thanks everybody for helping me. I appreciate it.
Posted 16 years ago2008-01-05 11:06:25 UTC Post #242649
Doesn't look bad, for a first project! (Me saying that tho I'm still working on my first project :) )
As far as I can understand, I should just func_detail every single wall I build...
Not every wall. just the detailed ones. Regular square rooms should just be enclosed by regular world geometry (brushes u build). Detailed stuff you build (pillars, other small stuff, stuff made of many small brushes etc.) should be turned into func_detail. That way the compiler should "understand" that the thing between four walls is a room and everything in it is detailed. So it will make only one visleaf for the room, which is good.
Posted 16 years ago2008-01-05 22:07:12 UTC Post #242720
Oooh right. Thanks for that ;)

So you don't 'set' the visleafs, you sort of just modify the things inside the room so it configures itself more sensibly?
Posted 16 years ago2008-01-07 09:23:52 UTC Post #242860
You can "set" visleafs by placing hint brushes, but that is not always necessary and should only be done in certain useful cases. The rest is done automatically when you place worldbrushes and detail brushes carefully.
You must be logged in to post a response.