News | Forum | People | FAQ | Links | Search | Register | Log in
Tyrutils-ericw V0.15.1
Hey, I got around to setting up a website for my branch of tyrutils: (complete with lots of screenshots of different settings of AO, sunlight, etc!)
and making an "official" release of it.

Nothing major changed compared with the last snapshot (may 1st), but a couple new things:

* .lux file support from Spike, for deluxemapping
* gamma control with -gamma flag and "_gamma" key
* rename -dirty flag to -dirt for consistency
* fence texture tracing is now opt-in only with the "-fence" flag.
* light should run a bit faster

This doesn't have lit2. Not sure what to do with that, tbh.

If there's a demand for it, I was thinking I could make a tool that upscales all textures in a wad by 2x or 4x, and adds a "-2x"/"-4x" suffix to the names. You could then manually get the higher-res lightmap on certain faces by applying the upscaled texture, and lowering the texture scale to 0.5 or 0.25 in your editor.

The only real disadvantage of this hacky method over lit2 is more face subdivision by qbsp. This isn't great, but it shouldn't be an issue if the hack is used sparingly (and bsp2 can be used if needed for higher face/vert limits.)

Anyway, enjoy, I hope this is pretty bug-free.
First | Previous | Next | Last
Bounce Lighting Alpha 
been fighting with this for a while now.. it's more or less in a finished state I think.

windows builds source

Command line flags:
-bounce enables 1 bounce (this is all that's supported)
-bouncedebug saves only the indirect lighting to the bsp/lit, for previewing
-bouncescale scales the brightness of bounce lighting, default 1. can try 2 or 0.5 for more/less indirect light.
-bouncecolorscale how much bounce lighting picks up color from the map textures, between 0 and 1. default 0 because this can lead to q2 style everything-is-gaudy. you can try 0.5 or 1.

Note, this is slow! light uses visdata now, I recommend only using -bounce on vised maps because that speeds it up a lot.

Other info: it works more or less like the existing "_surface" light system; point lights are generated on each face to bounce light back into the map. Currently there is no face subdivision for this, so the bounce light given off by really large faces will be coarse (all coming from just 1 point light). 
Sounds Interesting 
I'd like to see a screenshot showing the effect though. 

left is with bounce, right is w/o. 
Its One Light Source In This Particular Map Shot 
mind you. 

"Without" shot used "-lit -extra", 9seconds
"With" shot used "-lit -extra -bounce", 39 seconds

the 39 seconds is with 8 threads, and vised map though. Just -bounce without -extra is something like 16 seconds. 
Ericw, You Are Teh Boss. 
oh man I am SO hyped for this! 
Cool, Ericw 
Will Test Today 
I do kind of wish for a more tolerant set of compilers like rebbs. 
Ok, this seems to have fixed a couple of issues in my map so I will be using this :) 
cool.. glad it works.
FWIW mfx and I did a ton of back and forth testing/fixing on phong shading, it's pretty solid now (though one glitch just came up that I need to look into)

check the BJP tools thread, I linked a build of txqbsp that is patch to write the phong shading info. 
Thanks Eric, I am more inclined to use those simply due to my god awful brushwork. 
Looking at the current source, you've implemented support for properly lit water.

Thanks EricW, I'll try it out. 
It works flawlessly, way better than my implementation.

I've noticed -fence was removed, but that's not a big problem for me.

I'll try out making some smooth shaded lit liquids now. 
glad the lit water works :-)

-fence I removed because it was done in a hacky way. I understand the trace code better now so can re-add it if anyone wants it. 
Re-Add Please! :) 
And May I Say 
Those screenshots are gorgeous! 
New Version 0.15.5 Is Up

New features:

- light: added a better options summary with the -help flag
- light: added -bounce option, "_phong", "_project_texture" key
- light: use vis data to accelerate lighting
- light: "_minlight_exclude" key to exclude a texture from receiving minlight
- light: add "_sun2" "_sun2_color" "_sun2_mangle" which creates a second sun
(unrelated to "_sunlight2" which is the sky dome light)
- vis: support .prt files written by bjptools-xt
- qbsp: add -objexport flag


- vis: fix ambient sounds when using func_detail, broken in tyrutils-ericw-v0.15.3 
Issue, Or My Mistake? 
Hi, I hope I don't come across as an idiot for asking this, but what exactly am I doing wrong to get this result?

Ignore the missing textures, but how do I fix my strange lighting on the map? I'm not running with any command line options, just the map bsp.

Thanks for any help! 
it's hard to tell from that shot if it's a corrupt file, or something else.
Check for any stale .lit files and delete them.

Might be easiest to just post the .map+.bsp. 
Thanks for the suggestion about the .lit file, I found one and deleted it and now everything is working fine! :D 
I tried the latest compiler tyrutils-ericw-v0.15.5-win32, but it glitches off.

I'm just an old time user, winxp etc but version
tyrutils-ericw-v0.15.4-win32 goes great.

No bad word here for the harworking improvements,
more a shout from an old map compiler. 
LIT File Size Mismatch 
This is an easy check engine-side and mismatches like this will never happen. Just check if com_filesize is equal to (l->filelen * 3) + 8; if so the LIT file is good, if not it's invalid and you can display a developer warning. 
Thx For The Info 
I changed compilers, will look into it. What is your CPU btw? 
yes good point! engines should really detect + print warnings + refuse to load invalid lit's. 
I think I fixed the problem, mind checking if this build works for you on XP? 
I checked a rather big map I converted from Sin.

When I use the TreeqQbsp v2.03 it compiles.
The newer version compile faster, but end up with a leak after bsp compiling.

Of course it can be my lame '06. 
Use TreeQbsp if that works, or I'd recommend using rebb's version of BJP qbsp/vis:

The main thing in my tools is light.exe which has lots of new options. 
Suggestion For Surface Lighting 
Hey EricW,

Forgive me if this functionality already exists, but I thought of something that would help with lighting control.

Is it possible that a func_wall, func_detail or func_group be given a surface light flag for individual surface light control?

The current setup (using the light entity) lights up each instance of the "_surface" defined texture, however there are times that I don't want every instance of that texture lit or times that I want different colours or intensities on said textures.

Hmm.. I can see that would be useful, but I'm not sure if can be done easily.

The surface light template (the light entity with "_surface" "xxx") can use any keys allowed on lights, so it would be messy to read those light keys from a func_detail/group/wall entity.

As a workaround, creating a duplicate of the texture with a different name, along with a new surface light, might be the best option. 
As a workaround, creating a duplicate of the texture with a different name, along with a new surface light, might be the best option.

That's similar to what I did for my Jam 6 map. I used TexMex to make a custom jam666.wad specifically for that map. I had textures that were the same but with different names. One with surface light and one without. 
Heya, yeah... That workaround... It feels like I'd be adding bloat to the map (not that it's an issue with such small textures or modern machines).

I spent the last few hours looking through the code... It's a bit beyond my skills to modify it. But I think I'm slowly getting a handle on it.

At the moment the program cycles through all entities searching for the key value "_surface", not just light entities. So it's possible to play around with lights on other entities, but there is no light drop-off with these.

I suspect that this has something to do with geometry detecting as worldspawn? because the output: "Creating surface lights for texture "DOPEFISH" from template at ()" omits the origin.

I thought that I might be able to modify the function to use a name key rather than a texture name for "_surface". Or modify it to read the colour and intensity keys from the geometry (as func_detail) rather than the light entity itself.

Either way, I need sleep. I might come back to this later and have another crack at it. 
Yeah, it's true duplicating textures adds some bloat.

At the moment the program cycles through all entities searching for the key value "_surface", not just light entities
I think that's an accident.. I'm currently reworking the entity handling code (on the master branch on github) to have a clear distinction between lights, bmodel entities, and other entities.

"Creating surface lights for texture "DOPEFISH" from template at ()" omits the origin.
Hmm, that is a bug.

I thought that I might be able to modify the function to use a name key rather than a texture name for "_surface". Or modify it to read the colour and intensity keys from the geometry (as func_detail) rather than the light entity itself.
The main problem with doing anything with func_detail/group in light.exe is the information about which faces correspond to the entity doesn't exist in the .bsp. I hacked something together for supporting a few keys on func_detail/group (_minlight, _phong, _dirt) but it was pretty awkward; the keys are parsed by qbsp, values packed into an integer so they can flow through qbsp's processing and are then dumped into an auxiliary file (.texinfo) which is then parsed by light.exe.

My hunch is it's not worth jumping through all those hoops for this feature, but it could be done.

btw, another workaround worth mentioning.. there is a "-surflight_dump" flag, which writes the generated lights to a file. so you can use "_surface" lights to generate a first draft version of the map lighting, dump the generated lights to a file, delete the "_surface" lights and paste in the generated lights, and then tweak them individually. 
Bouncy Castles 
The bounce feature looks badarse. I have a question though - how are the bounce lights attenuated? Does the attenuation of bounce lights depend on the attenuation of the source lights? 
The bounce lighting is hardcoded to use 1/(distance^2) for now, regardless of what the source lights used.

What happens is there's a regular lighting pass, then the average light brightness / color received by each face is calculated, which is used to create lights for the bounce lighting pass.

So this means a delay 0 (linear) light uses linear falloff for its direct light, but the reflected light acts more like delay 2. Hopefully this makes sense! 
Sounds good!

Another question - I understand a single "bounce light" is generated for each face.

This sounds similar to the surface lights features. The issue I found with that was the intensity of light created depends on the density of faces on the surface - this is a problem I found particularly noticeable with large surfaces like liquids that get split in unpredictable ways.

Is the intensity of bounce lighting affected in the same way? Or are the bounce lights created taking the face area into account? 
Ah, yeah, I ran into that problem with surface lights as well, where lava was noticeably brighter around rocks that caused the face to be split up. Bounce lights shouldn't have that problem; they are scaled by face area, so the overall scene brightness should remain constant if faces are split up.

I also found hotspots (where you could see the individual lights) were a problem with "_surface" lights - especially when used on things like lava.

The bounce lighting has a hack to work around hotspots: there's a distance threshold of 128 units, where bounce lights have the same brightness within that distance. 
Ace biscuits :)

Are you planning to use those bounce light ideas to improve surface lights in that regard? 
Yeah, it's something I wanted to do! 
Cool Beans 
Been playing around with bounce and it's super cool.

Different topic...for me it seems _shadows 1 is broken now...

Link to bsps and map files:

Test case is a simple func_illusionary torch holder, with _shadows 1...

temp01a.bsp, lit with tyrutils-ericw-v0.15.4-win32:

temp10b.bsp, lit with tyrutils-ericw-v0.15.5-win32:

(ignore the fact that one shot has coloured light, and not the other - that was just me accidently invalidating the lit file when renaming the bsps) 
Note - it's not like shadows are disabled, in some cases, shadows are cast, but they are glitchy looking (e.g. the torch holder is actually shadowing the bit of floor at the base of the pillar, but the vertical sides of the pillar are ignored) 
Thanks For The Test Case 
will fix this..

It's related to how sample points are positioned on a face, by tracing from the face midpoint to the desired position and stopping at any obstruction. I made _shadow models obstruct this trace, which was a mistake, so it ends up sampling the light value above the torch holder for the samples that should be located under it. 
nice one :) 
_project_texture Lights 
Is it possible to flip / rotate the texture that a light projects? 
The 3rd param of "_project_mangle" should be the "roll" value that controls rotation.

btw re-posting from the jam thread:
I think "_project_mangle" is buggy, the docs say it expects "yaw pitch roll" like a spotlight mangle, but I think it actually wants "pitch yaw roll".
I'll fix that in the next light release to be consistent with spotlights, so it's experimental/unstable only for now.

Also I think I fixed the bmodel shadow issue, hoping to make a new release soon! 
Rock 'n' Roll 
Sorry, I'm a tard - roll totally works :} I guess I was just following the description of mangle in the readme (which said roll does nothing, so I didn't bother trying it)

However, a way of flipping the image would also be real nice (for those asymmetric stained glass window textures). 
oh and awesome news re: the shadow issue - cheers :) 
Darkplaces Lighting Fix - Rounding Of BSP Texture Vectors 
Mapping Help, Post #15623:
@dumptruck_ds I got a hack for qbsp that seems to fix the DP lighting issues in your map. Here is a test build:

(I just added rounding for the bsp texture vectors, the same algorithm that is used for points - if a value is within 0.0001 of an integer, round it to that integer. It's not a proper fix but it seems to work decently well.)

Ericw, I can't find where I downloaded this test build, do you still have this?

Also, I found possibly a bug...maybe with JACK(hammer). When I compile I get a string of warnings:
line 11: Unrecognised string escape - U
line 11: Unrecognised string escape - J
line 11: Unrecognised string escape - D
line 11: Unrecognised string escape - Q

These correspond to letters in the directory path after slashes in the .map file JACK generates. For instance: "C:/Users/Josiah/Dropbox/QUAKE..." Compiler thinks they are escape characters like newline n<q/> for instance. The map still compiles, it's just annoying to have warnings. 
re: Darkplaces Lighting Fix: that stuff is in the most recent release (v0.15.5) at:

Are you still having corrupt lightmaps in DP with this version? In my experience it only happens occasionally on faces with weird texture alignment (e.g. sheared texture). e.g. a few faces in ad_crucial.bsp from Arcane Dimensions have corrupt lightmaps in DP.

about the escape sequences warning, yeah, it's confusing... I should probably just suppress the warning for the "wad" key of worldspawn. 
Escape Sequences Mini-rant 
there's nothing wrong with "c:/foo/bar/naff.wad".
there IS a problem with "c:\foo\bar\naff.wad" because that contains a new line and two dodgy chars.
"c:\\foo\\bar\\naff.wad" is fine of course, just ugly and specific to windows.
there's an even bigger problem with "c:\foo\bar\" because that string isn't even terminated properly. And yes, I have seen that in maps, and yes it does screw things over, and yes I hate the idea of getting the engine to do special things just because of the name of the field.
Its common enough that a terser and more specific warning would make sense, but I'd personally prefer if everyone just started using string markup consistently instead of varying depending on arbitrary field names.
Idealism can suck sometimes. 
I had a quick look at the winquake source.. these are my 2 cents:

- Double-quote characters can't be escaped, whatsoever (COM_Parse). Winquake, DP, FTE all fail with parse errors if a trigger_once's "message" string is "foo\"bar"

- The only escape sequence recognized by vanilla is \n, which gets converted to a newline character. (ED_NewString). Otherwise, the backslash and next character are left as-is.

Writing paths like "wad" "c:\foo\bar\naff.wad" would only be dodgy if the engine/gamecode needed to use them. Everyone uses forward-slashes for paths meant to be read by the engine/QC though ("noise" "sounds/nnnn.wav", etc.)

"wad" "c:\foo\" is not a problem because double quotes can't be escaped. A trigger_once with "message" "foo\" works fine in winquake, DP, and FTE (though FTE centerprints foo" instead of foo\ )

What would be a real problem is a wad path with double quotes in the directory/filename.. apparently that is forbidden on Windows, but OS X seems to permit it. Anyway, if anyone tries that, qbsp would fail to parse the .map file. 
How about making the compiler replace the backslash character with a forward slash, in the "wad" field only? 
I always wondered why it couldn't just check the relative Quake path for any wads or just require that the wads be located in a specific folder. 
@ericw, Continued Rant :) 
enginewise, the biggest issue is that saved games and maps share parsing code. So double-quotes, new lines, carrage returns, and double-backslashes need to be saved, and thus also need to be reloaded. Otherwise mods will break - or at least mods designed for engines that can actually do string manipulation, anyway.

Whether that's consistent with winquake is somewhat irrelevant from my perspective - as you say, the only place backslashes would ever really be used in a map is in the wad key, or before an 'n'.
I'm personally okay with FTE breaking compat from winquake to ensure saved games work, so long as embedded chars are rare and don't corrupt other strings.

small correction:
FTE's entity parsing is actually performed by qclib's misleadingly named QCC_COM_Parse - which includes consistent escapes and a special hack for "c:\foo\"<NEWLINE> in an attempt to prevent the map from being unusable.
This is why you get foo" instead of foo\ - because FTE saw an escaped double-quote.

The wad field *IS* parsed by engines in the case of halflife bsps, where named wad files may be required for external textures. The paths are ignored (absolute paths are a definite no in something that has been shipped/released), but if they arn't escaped properly then wads starting with an n will still get messed up (clients with download mechanisms might also attempt to download such wads from servers). Additionally, fte can load .maps directly, although wad handling there is curently kinda screwed up thanks to replacement images overriding things and confusing sizes.

@mankrip, really its the editors that should be doing that, especially for relative paths which would allow such maps to still be compiled/loaded on linux/mac as well as windows.
Obviously absolute paths are problematic regardless.

@Rick, some -basedir argument for qbsp?.. and probably -game too... 
@mankrip, really its the editors that should be doing that

I agree that fixing this in the editors would help for when creating new maps, but for compiling old maps it wouldn't, specially if the user wants to compile some old maps directly from the commandline.

The Quaddicted database has tons of maps with source available, and sometimes it's useful to recompile them without modifications, when all the user wants is to compile them in a different way (e.g. enabling translucent liquids or lit water).

So, an ideal solution would be to fix this both in the editors and in the compiler - fixed editors would ensure that the maps can be compiled by any compiler, and fixed compilers would accept maps from any editor. 
even if you are recompiling it without any other edits, you'd probably have to fix all the wad paths anyway.
tbere's enough existing maps that auto-correcting the wad paths for any new ones is a little insignificant. I would personally rather that editors were aware of \", \n, \r, \\ when loading rather than \ getting switched to / in specific cases that 'the' engine will already need to deal with regardless. 1 well-worded warning is imho useful, 4 is excessive but still preferable to none.

on a related but different note, casually recompiling all your maps isn't something I can really endorse - if you do this, you'll find yourself kicked from vanilla quakeworld servers due to having an assumed-cheat version of the map.
vispatches and lit files won't trigger this issue, and can automatically run on maps without worrying so much about which qbsp originaly compiled it and how strict it may have been.
This won't give you everything, so there's no single winning solution, but it should give more consistant+reliable results if you're doing it in bulk. Assuming those tools support bsp2 etc, anyway. 
@Rick, some -basedir argument for qbsp?.. and probably -game too...

Something like that I guess.

Netradiant wants the wads in the ID1 folder. Put them there and it works fine, anywhere else and you have no textures in the editor.

Frequently I dig out old maps from years ago and run them through QBSP and get no textures errors. Then I have to go manually edit to fix "wad" "E: \\ worldcraft \\ test.wad" or whatever I was using back then.

I'd rather the map just used "wad" "wadname.wad" and let the compiler find it (with the assumption that the wad is somewhere in the Quake folder). 
Does Your QBSP Support Decimals As Texture Offset Values? 
Who Else Would Need To Move Textures By Fractions Of Pixeks 
After You Rotate A Texture Probably 
yeah, if you do the classic 1:4 2:4 3:3 4:2 4:1 cylinders, you will have some angles that you can't perfectly line up the textures on with whole degrees. Not noticeable until you have a long enough surface with the same angle 
I'm getting this error with my map:

light: /home/benny/Downloads/tyrutils-ericw-ericw-v0.15.5/light/ void CalcualateVertexNormals(const bsp2_t*): Assertion `smoothedNormals.find(v) != smoothedNormals.end()' failed.

As well as a bunch of: WARNING: couldn't nudge light in solid at -1586.848267 174.062302 507.337677

Which I assume is because some of the surface light textures cover the entire brush and some are against other solids.

This same map didn't give me errors with an earlier version. Running ubuntu 16.04.

Also, isit possible to have phong shading on non func_details, I have a func_illusionary or two I'd like to use it on.

Thanks in advance! 
Mind emailing me the .map+.bsp+.texinfo?

phong shading on any func_ should work. You have to run a full qbsp to update the .texinfo file though.

btw hoping to make a new release pretty soon 
the new version compiled and works a treat.

also the "-gamma" command is amazing, saved me having to decrease all my light values after adding -bounce 
Dirtmapping Lit Liquids Bug 
Liquid surfaces should be completely ignored when dirtmapping, but they aren't. Here's an E1M2 screenshot.

Ideally, lit liquids shouldn't receive or emit dirtmaps. 
I've taken that screenshot with the water fully transparent, and the map was compiled with these parameters:

$bsp_exe -nopercent -splitspecial $bspdir/$file

$light_exe -extra4 -dirt -dirtmode 1 -dirtgain 0.875 -dirtscale 1.5 $bspdir/$file 
What If The Liquid's Supposed To Be Opaque? 
"_dirt" "n"
For brush models, -1 prevents dirtmapping on the brush model. Useful it the bmodel touches or sticks into the world, and you want to those ares from turning black. Default 0.

Maybe it will work with water brush too? 
I've just tried it, and _dirt -1 doesn't work on func_detail. 
Well, actually _dirt -1 sort of works on func_detail. The water isn't dirtmapped now, but it still casts dirtmapping in the rest of the world model. 
Thanks for the report, I will fix it properly.
Probably I'm checking for TEX_SPECIAL and skipping casting/receiving dirt if that is set, need to also check if the texture starts with
"*" or "sky" in case splitspecial is used. 

A little feature request: Can you add individual options for -splitliquids and -splitsky? This would be more optimal than -splitspecial, since there's usually no reason to allow sky surfaces to be lit. 
It should be there already, just called -splitturb instead of -splitliquids 
:) Indeed 
It is; I've tried it out, and it worked.

Thanks, I've updated my compiler parameters. 
Gosh I had no idea lit liquids were even supported in this tool. Any chance someone could give those quakespasm cheps a bit of a nudge? 
V0.15.7 Released 
Get it at:

Not really any new features, but lots of performance improvements. It's something like 2-4x faster depending on the map.

Also fixed the regression with bmodels touching the world that Kinn reported.

full changelog: 
minlight no longer bounces

I can't even begin to imagine how that worked or looked. 
V0.15.7 isn't compiling at all here.

** Executing...
** Command: C:\Dev\Tools\tyrutils\bin\qbsp.exe
** Parameters: -nopercent -splitturb C:\Projects\QuakeDev\Game\Quake\_QDebug_\maps\E1M2

* WARNING: File was not built!
It was the 64 bits version. The 32 bits version is compiling fine. However, I'm on Win 7 64-bit. 
Maybe try installing the 64-bit version of the msvc 2013 runtime (vcredist_x64.exe)? 
I'll try it.

In the meantime, I've confirmed that the worst part of the dirtmapping bug is now fixed; liquids won't cast dirtmaps on the world anymore.

They still receive dirtmaps, but at least this problem can be worked around by func_detailing them with _dirt -1: screenshot
Wow, 0.15.7 is incredibly fast! I don't have specific times, but it speeds up light on my map by a huge amount. No idea what kind of wizardry was performed for this, but it's really cut down on the iteration time for my map. Thanks so much! 
Pritchard - awesome :)

got some bugs reported and fixed already (to be in the next release):
- the "unmatched" target warning was broken
- skip-textured func_'s with "_shadow" "1" were broken (for making invisible shadow casters)

This one was tricky due to how I migrated light away from using the BSP for raytracing. The workaround I implemented has a limitation that the entire bmodel has to be textured with "skip", otherwise the skip textured bits don't cast shadows. Hopefully this covers the common use cases for that trick, though. 
That looks pretty damn cool. How did you get the water to draw shadows like that? 
Only A Warning, I Assume This Isn't A Big Issue 
thought I would report it just in case.

vis.c: In function �LoadPortals�:
vis.c:1120:9: warning: ignoring return value of �fscanf�, declared with attribute warn_unused_result [-Wunused-result]
fscanf(f, "\n"); 
Using independent surface caches for texture & lighting, and combining them in realtime.

The drawing routines of liquid textures (and now, of power-of-two textures too) were mixed with the drawing routines of regular surface-cached routines, combining the texture & lighting in realtime before blending the result into the framebuffer.

It's not difficult to do, just really tedious. Involves modifying and rewriting a lot of code. 
Func_viscluster Support 
@ericw: I'm curious if it would be possible to add support for func_viscluster brushes in order to negate large open spaces. I'm of course assuming that vis leafs automatically chop up empty space into leafs every 1024 units.

Host_Error: Mod_LoadLeafs: 121741 leafs exceeds limit of 70000. 
AFAIK, there is no chopping of space every 1024 units in this qbsp, that feature was added in quake 2's.

func_viscluster - this sounds like purely something to speed up the vis computation. It's probably possible to add to Q1 tools, it wouldn't help with reducing the number of leafs though. 
Strange Bounce Bug 
This just popped up now as I'm working on my map. Bounce lighting started generating random black spots in this one room of my level:
screenshot 1
Here's how it looks with bounce lighting turned off:
screenshot 2

Any idea what's causing this? I was changing my light entities around, but I can't figure out what I did that caused this. Has anyone even seen this before? Help would be greatly appreciated :s 
At least somebody's happy about this...

I tried running the map through 0.15.5 and the issue went away. I'm guessing then that this is an issue caused by the new approximation methods in 0.15.7... 
I Should Really Try Before I Speak... 
I hate making a third post like this, but I tend to write in a very "stream of consciousness" manner... Anyway, I tried the -novisapprox flag on the command line and the issue persisted, so that's not the problem. 
I've never seen that, definitely a bug. mind sending me the bsp? 
Sure, I just shot off an email.

I'm guessing it is some kind of regression from 0.15.5, although I couldn't say what other than that it seems to be bounce-related. 
I got an email back from eric and the bug was fixed. Thanks for the quick response! :) 
Please Help Me? 
Could somebody help me with this little thing that annoys me so much : 
can you turn off texture filtering in game and see if this still happens? 
bilinear filtering -- the last row of pixels blends with the first row of pixels, since it's a tiling texture. 
In the black/red colored view it looks like the texture is mirror imaged. Is it one continuous surface going from from red to black or is it actually two different brushes? 
It is same exact texture but one of axis is mirrored "-1" it is 128x128pxl, and those brushes are exactly 128x128 and next to each other.. so filtering is making this to happen, that is looks like it is.. like 0.5 pixels or something? filtering is making it to look, like it is 0.5 pixels off or something* 
get up close and toggle between gl_nearest and gl_linear and you'll understand what's happening. You'll need to hide this pixel-wide blend by not using the full width of the texture on that polygon. Either scale it up slightly or make the polygon slightly smaller. 
Thanks metslime, I haven't tried scaling up yet - maybe that will work. 
Any time there is a difference between the textures on adjoining surfaces there will be a noticeable line if GL filtering is used.

I call them GL seams, and any kind of rotation, x/y shift, flip, mirror, etc. will cause it. Even just pixel color differences will cause it. 
It is interesting.. it really looks like there isn't different pixels in this case, if I understood what you meant by that. I have no clue how GL filtering works, so basically I can't avoid these things to happen.

For example I should create texture that points out on every main angle? Then I should have seamless street texture to fill everything in middle.. I was trying to create streets which has some messy garbage on both sides but middle is a lot cleaner. It really seems like that brown/black line in middle is like texture's starting pixel line, because its end and beginning has different pixel colors. The way GL filtering works.. does it look every texture individually and doesn't care about rotation, x/y shift, flip, mirror at all and that is why something like this happens sometimes? 
Does it try to blend blend pixels with next pixels.. if I offset it by 1 it is already in beginning, so it tries to blend with those pixels? 
What I did when making a series of similar textures was to create one common frame to use for all. Basically just the outer 1 pixel border of a 64x64 square. I used that to make different variations where the middle part was different but the pixels around all four edges are exactly the same for all.

For 128x128, I just repeated the 64x64 frame. Textures made this way have no GL filter seam/line as long as they meet at the 64 unit boundaries.

To make sure no weird texture alignments happen, I never use texture lock. I only turn it on if I really need it. 
It Blends The Next Pixels, So Yes The Dark Pixels Are Wrapped Around 
I thought we would have moved on from GL filtering as a society by now. Horrible concept really. Yay filtering. Let's blur all the textures. No glasses for you and contacts thrown away for you and baske in the glory that is nearsightedness on a screen.

(P.S. I'm nearly blind and need powerful contacts so I may be biased.)

Also this blending is not a compiler issue. The adjacent face has a different texture alignment and therefore is split into a separate face for blending purposes but thats the extent of compiler related. 
I might have used texture lock too much.. sometimes it was just left pressed down. Checking something like that multiple times, especially when placing lamps and such things confuses a bit.

I must be weird, because in some cases I want to have more control over things how wide/high some brushes should be.. and if there is only texture available that is 32x32 for example, but I want it to be 16x32 or 32x16 I have to cut it and offset other half so 'borders' are in right place. Creating new textures sounds like, I would probably fail at trying, I'm not an 2d artist by any mean. 
You could split an existing texture in two halves in PhotoShop, then use them in your maps. This way you wouldn't have to offset your textures, which can be tedious. 
Its So Simple To Fix 
Just make the road so there's three brushes across the width instead of just two. 
Thanks Kinn, but I also tried out.. scaling up a bit and it worked. But if I need to do wider roads.. then I need to use your advice. 
Re: Ericw, Mapping Help Thread Post #17150 
don't worry, Linux package management just sucks..
what's the error?
I have hit the same thing on debian/ubuntu before, there's some magic flag to make apt-get work usually. also maybe we should move this to the OS thread...?

Thanks for being willing to look at it.

Initially when I typed "cmake .. -DCMAKE_BUILD_TYPE=Release" from within a newly created "build" directory as per the instructions that come with tyrutils-ericw, I was told that I had to install cmake using apt-get ... which I did, and then weird things happened.*

I thought the installation of cmake failed, because I still could not get the build process to work. I had another look, though, and it seems like the installation did work, but I need a higher version of cmake than the one that is in my OS's repositories:

cmake .. -DCMAKE_BUILD_TYPE=Release
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.1 or higher is required. You are running version

-- Configuring incomplete, errors occurred!

...which means I need to compile cmake from source, I guess?

*If you're interested, I can post the weird stuff that happened too. Basically, as soon as I typed "sudo apt-get install cmake", the terminal window was taken over by the drupal configuration/installation process, which keeps failing. This happens whenever I type "sudo apt-get install cmake" again. 
OK, the problem is on my end; I thought I supported Ubuntu 14.04 but mixed up which cmake version it had. I'll see if I can adjust the cmake script and report back.. 
Ok, I made some changes and updated the instructions for Ubuntu 14.04 x86_64:

If you are running 32-bit there will be more work to do but it should be possible as well 
Correct Link 
Absolute Path Not Possible With Qbsp. 
Not sure this is a bug, since it look deliberate in the code, but it would be interesting to know why. :) It treats any argument that begins with a '-' or with a '/' as a switch. Absolute path (linux), including relative to home, will begin with '/'.

Anyhow. It was an easy fix and the tools are awesome. 
@ericw, Re #534, #535 
Thank you! Will check it out and report back. Luckily I'm running 64 bit on my current primary computer. 
Thanks, those instructions worked. :)

Now I just need to gather enough courage (and set aside enough time in case of repeated failure) to attempt building TB2 as per your instructions, and I'll be back in business. 
Netradiant / Qbsp Leak Finding 
How are you guys going about finding leaks using netradiant and qbsp/txqbsp? Specifically looking to find the "Detail Nodes facing the Void". I can use q3map2 to find normal entity leaks, but it doesn't work for func_stuff. Is there an easier way than hunting through the map seams? 
The main idea is to use the pointfiles (mapname.pts) output by qbsp/txqbsp. The quake engine can load them with the "pointfile" command. I use Trenchbroom to load them.

re: "Detail Nodes facing the Void" warning, this is unique to how func_detail was integrated into Quake tools. It's not the same as a leak.. as far as I know, the only problem that warning can cause is reduced vis quality (the fact that this is an issue at all may be a bug in vis, not sure.)

To avoid the warning: having world brushes seal in the func_detail is not good enough, because detail clips away world, and the warning happens after the CSG phase when every brush is clipped against every other one. You want to ensure there are some non-detail *faces* left in the final bsp (what you see in-engine) that, if you extend the planes they are on, enclose all of the detail faces.

e.g. if you have an outdoor area where the entire floor is detail, I think you will get that warning 
So, I did some experimenting and func_detail can actually be used to seal the map. Um...what?? Also, func_detail brushes are still being used to slice up the space into more and more leafs. Again...huh?? So func_detail is essentially worthless except to speed up vis then? I could use func_wall to save on leafs and not worry about leaks mysteriously showing up when I hide the (leak would be there anyway).

I thought the point of func_detail was to not affect vis, like, at all. No leafs added, no slicing other brushes. Is it possible for func_detail to work like in Source: 
func_detail will always cut up brushes. It's sole purpose is to speed up vis. 
Purely Out Of Interest 
Assuming latest ericw tools are used, what are the downsides of using buttloads of func_wall in place of func_detail? 
func_wall lighting might get a bit funky. You'd have to remember to include things like _shadows and _dirt etc.
That's the thing I can think of mostly being affected. 
The other issue with using brush entities is that you are contributing to the entity count. If you're trying to stay under 255 ents for extra compatibility I guess then it's better to stick with func_detail. 
func_wall downsides:
- counts towards entity limits (I guess they are probably static ents?)
- likely will have overdraw?
- they can have different rendering performance quirks depending on the engine (and how well the GL driver optimizes what the engine is doing).

Quakespasm: there is some setup cost per-func_wall rendered, but they use the same drawing code as the world, so they can have lots of faces and still render fast

Fitz085 and I believe MarkV use R_DrawSequentialPoly which scales badly on funcs with lots of faces 
Also, func_detail needs to create leafs, otherwise collision wouldn't work, rendering might break depending on the engine. The engine needs to have been designed with func_detail in mind to support not creating leaves (q2/q3/source?). 
Func_wall Lighting 
Ok. On a related note, can func_wall have keys added to receive and block lighting identically to a func_detail. 
"_shadow" "1" 
You're The Best, Thanks! 
Is there a simple reason why the light tools can't be extended to produce lightmaps of essentially arbitrary resolution?

More generallly, -extra 4 is still producing aliased shadows for me (e.g. here: Is there anything I could try to get better looking lightmap resolution? 
It would require new file formats and engine support I would imagine.

This was thoroughly investigated a while back and actually got working, and from what I remember the feedback went something like:

"Oh this is cool but a bit too sharp actually, can the shadows be made softer?" (makes it softer) "Hmmm, even softer?" (makes it even softer) "...softer still?...ok actually on reflection I think quake's default lightmap resolution actually looks better but thanks anyway ^_^" 
I imagine the tools to generate the lightmaps weren't as good then? From what I can tell the quality of lighting improved quite a bit in the last N years. 
Lightmap Resolution Is Tied To Texture Resolution 
This is a limitation of the vanilla BSP format. Lit2 solves it, but only a few engines supports it. 
I think it was only something like one year ago when this was explored. Might be wrong - my temporal awareness is somewhat shoddy to say the least. 
what about "-soft 2" or even more? 
higher-res lightmaps have their perks:

the biggest issue is that lightmap changes (both flashing lights and dlights) become abusive, which essentually requires multithreading and/or rtlights in order to prevent it being unplayable, which greatly limits the number of engines willing to implement it.

crank it up to max and the bsp files become insanely huge, but that's only to be expected from poor-man's megatexture. :)

either way, the stepping issue doesn't really go away. the only way to fix that is to use cubic filtering instead of linear filtering.
currently this requires custom glsl. I really ought to investigate it some time. :s 
I think there is also some room to improve the filtering within light.exe.. it's using a box filter for -soft and -extra, which is the worst possible filter, I want to try lancosz or others.

Anyway to get the best quality currently you should combine -soft and -extra4.
-extra4 alone will be sharper but have more aliasing 
Thanks for the explanation all 
the biggest issue is that lightmap changes (both flashing lights and dlights) become abusive, which essentually requires multithreading and/or rtlights in order to prevent it being unplayable, which greatly limits the number of engines willing to implement it.

As an aside, I've always thought the ideal handling for light styles would be to upload the four styles as 4 separate textures and combine them using multitexture (or multiple passses) when rendering. Are there any engines that do this? 
rmqe does, iirc.
my engine that tries to draw the entire worldmodel in a single draw call also does.

the fragment shader is a bit faster if you do all 4 lightmaps with a single texture, at least when there's no lit support. you can then do the style->value lookups in the vertex shader and your fragment shader basically gains only a dot4product compared to a luma texture. 
Its A Bit Hacky 
but couldn't the engine be modified to interpolate hard edged shadows? 
As an aside, I've always thought the ideal handling for light styles would be to upload the four styles as 4 separate textures and combine them using multitexture (or multiple passses) when rendering. Are there any engines that do this?

I also have working, but unreleased, Q2 code that does this. It also needs 2X modulate support, but in practice anything that's not of 3DFX vintage has that. It's possible with basic GL_ARB_texture_env_combine but much easier (and nicer) with shaders.

The basic formula is texture * light0 * style0 + texture * light1 * style1 + texture * light2 * style2 + texture * light3 * style3, or texture * (light0 * style0 + light1 * style1 + light2 * style2 + light3 * style3).

You can do it with multitexture and a single shader, substituting 0 for the style value (and using an all-black texture) for styles that a surface doesn't have. Pros is code simplicity, everything goes through the one code path, fewer state changes; con is extra texture accesses.

You can do it with multitexture and 4 separate shaders, trading off texture lookups versus state changes.

You can do it with multipass and a single shader; similar tradeoff as above but with added overhead of extra draw calls too.

Fastest way is if you've monochrome lighting so it becomes a single texture access and a dotproduct: texture * dot (lightmap, styles).

Performance is similar to stock GLQuake for scenes without many lightstyle animations; it's one of those optimizations where you shouldn't expect it to double your framerate in DM3, but if you play a map with lots of lightstyles it works great.

What's nice is that you can then add lightstyle interpolation to the engine and get it for free.

For dynamic lights you do something similar to RT lights which works much nicer for MDL files because you've now got proper directional shading and attenuation on them instead of them just being uniformly lit. 
Pros is code simplicity, everything goes through the one code path, fewer state changes; con is extra texture accesses.

Would the texture accesses problem be solved by making sure all 4 styles end up on the same texture atlas? Or is it just the literal lookup into 4 different pixel locations? And is that anywhere near the cost of uploading new textures? 
Or is it just the literal lookup into 4 different pixel locations? And is that anywhere near the cost of uploading new textures?

It's 4 different locations, one for each style.

It can be mitigated by replacing texcoords for unused styles in a surface with {0,0} (so that the lookup will be in the GPU's texture cache) or by using a 1x1 black texture for lightmaps of unused styles (same reason), but again we're getting into state change tradeoffs.

Comparison with cost of uploading new textures is an "it depends" answer. If you've a switchable lightstyle like the ramp in e1m1 then uploading is going to be faster. If you've a room with hundreds of surfaces each of which has multiple torch flicker animations on it, then uploading is going to be slower.

On balance I think that irrespective of which method you use to handle animation, it's the right kind of optimization. What's already fast either remains fast or drops a little, whereas performance of what's slow comes up and best case is levelled. 
I forgot to mention this.

Rather than using 4 textures, one for each style, with 3 of the RGBA channels used and the 4th unused, an alternative is to use 3 textures, one for each of R, G, B with the styles packed into the 4 channels. That both saves memory and reduces those 4 lookups to 3. 
Why 4? 
Seeing as we're talking about lightstyles etc. right now I thought this would be a good time to ask: had there ever been an attempt to raise the number of lightmaps past 4?

I ask because as a mapper i've run into the issue a few times, and its pretty annoying when it crops up. i understand the need for such a low limit in the past, but is there any particular reason other than a desire for compatibility that we still have it? I can't imagine that there are many computers today that struggle to switch lightmaps frequently... 
Why 4? 
It's not a problem for RT lights.

For lightmaps it would need BSP format changes as well as engine and tool changes. I don't know/can't remember why we didn't do it for BSP2. 
One thing that may help, in the next release I made light.exe not blow up when the "too many light styles on a face" warning happens. It will compute all the light styles and then save the brightest 4 per face. 
There'll still be a warning, right? Not knowing why you're not getting the desired results would be pretty frustrating and cause a lot of forum posts! 
Yep the warning is still there 
One of the quirks of Quake, in terms of engine, tools and formats, is that it's stuffed full of hard-coded magic numbers like this that can make extending limits while retaining compatibility sometimes impossible.

Unless you actually knew, you'd think that it would be reasonable to suppose that each face structure would have an int member indicating how many lightstyles it has. I know I'd think that. So you might be surprised to learn that it actually doesn't - instead there's a flat array of 4 styles and that's fixed by the BSP format.

What's even more fun is that the code is littered with cases where sometimes a #define is used but other times the number 4 is hard-coded. 
Ctrl=f "4", Replace "x" 
That does sound like great fun.

I like to daydream about one day just taking quake and gutting it and building something similar that's barely compatible but much more friendly and so on. Really just daydreams though, I don't know C. And I don't want to really deal with fun 
I've been wondering if I could use this feature to get smooth blends of textures for my map, i.e. a gravel path that fades smoothly into grass, but unfortunately all that _project_texture seems to do is basically tint the colour of the light a bit, with some textures that have significant colour differences producing multi-coloured lights

Part of me thinks that this is something that just can't be overcome; an issue with lightmap resolution, or something like that. But I feel like I should still ask; is it possible to get more fidelity out of this? If it's already possible, how do I do it?

It's hardly dealbreaking if it's infeasible, but it'd be nice to have... 
texture projections are still just a lightmap trick, so there's a resolution of 1/16th of your normal res. think of it as just a filter over the light, projected by a single side of a small cube around the light (you can distort the cube a bit by using the fov, the other 5 faces of the cube are black).
so yes, all it does is basically tint the colour of the light.

which means that if you make some white image and scale that up 16-fold, then you'll get the same lightmap res as the nearby textures without depending on engine extensions (lit2 would allow you to scale the lightmap per-func_detail without needing new textures).
But... you'll probably end up shining light on the neighbouring surfaces too, so it'll be a bit too hard to control.

it'd be nice to do some sort of alpha blending from one side of a face to another, for a nice blend, but politics and compat issues would make that an absolute nightmare.
If you really want that, q3bsp+terrain shaders is the only proper answer right now. 
The only portable (across engines) way to increase the lightmap resolution is kind of a hack, scale up a texture by 2x in the wad file (e.g. 64x64 to 128x128), and then use a texture scale of 0.5 in the map editor.

_project_texture only really works for stained-glass windows like spike's screenshot in post #558. Another point: the projected texture will look less like mush if it's projected over a larger area / further from the light source.

For texture blends the best bet is just make custom textures or use a wad with them. Even ignoring the resolution issue, the lightmaps are multiplied by the texture colors, so it would look like grass projected on top of rocks etc. 
Oh Well 
I figured there would be issues like that. My gravel path shall continue to fail the existence test. Thanks for the explanation though, good to have my suspicions confirmed. 
I remember some fantastic-looking hi-res textures of earthy/rocky paths blending into the grass on the sides, made for Oblivion. They might not be exactly what you're looking for but they could be worth checking out for inspiration. 
It would be nice, and maybe i'll take a look in that direction, but i'm not too invested in this idea and frankly finding an appropriate wad or making one myself would take far too much effort for the results i'm looking to get.

You can see where the path would go here, on the grass with the two dogs. It's a pretty small area and so i'm just going to drop the issue now. 
There Is An App 
Called quake texture tool.

Allows you to blend two textures together. I've tried it and it gives mixed results. Give it a whirl, you could probably get better results using other methods, but the tool is pretty quick. 
There's a nice one in : <a href="">9th row, on the right.. it looks better than that preview, i think it's 128x128 
someone needs to come up with something cool with fence textures acting as decals. especially if they move... 
that does look nice (judging by the preview) but I'm not seeing any corner pieces; that's what's stopped me from using the hexen 2 textures too, since that's where my grass is from right now; it has a dirt path, but there's no texture for the inner corner so it's pretty useless. 
Can't you find a way to make a corner yourself with two 45-degree-cut brushes and play with texture alignment so the seam isn't too noticeable? 
I Feel Like I'm In Mapping Help 
Perhaps, but historically it hasn't worked very well. The hexen textures have a very nice blend into the dirt texture, with defined blades of grass that'd make it difficult to capture the same effect with brushwork (i'd say impossible).

Trying to make up for texture deficiencies with brushwork is normally a losing battle. Quake's gridsize only goes so small, after all. 
Just fire up Zendar and look at the ground in the opening valley. That sort of thing is the best way of doing it I think.

Quake's all a bit "squint your eyes and it kinda works". There's no point getting too perfectionist about this. 
Minor Update V0.15.8 
Oh Boy 
My name, preserved in a changelog for all eternity! I'm gonna be so famous! 
Thanks for the update, Eric - and Pritchard :) 
.DLL's Required? 
There are 3 .dll's in this release(V0.15.8) that I just downloaded, is that a thing now?

I only ask cause I've never seen anything but .exe's for the build programs until now.

"embree.dll, tbb.dll and tbbmalloc.dll" 
I'm using an external raytracer (embree) in light now, mostly for performance. It's open source (Apache v2) and developed by Intel so it shouldn't be sketchy. The dll's are downloaded from: 
Okay, thanks. 
Bounce lighting is a crutch

i blame you for my lazy light work ericw >:( 
I would say exoskeleton rather than crutch. Nice lazy light work, Pritch, I love the chiaroscuro effect. 
Thanks, it's always nice to get compliments with fancy words I have to Google. I'm not really ashamed of how much I'm abusing the feature, it's a wonderful way to get smooth, soft lighting (those jagged edges are with soft and extra4!). I try to rely on visible sources where possible so having them reach as far as possible is a great help in a lot of ways.

I will say though that it's a shame it doesn't work for switchable lights! That's how I ended up with that before and after pic, adding a targetname to the light... Ruined my idea of an ambush in the dark... 
"I try to rely on visible sources where possible so having them reach as far as possible is a great help in a lot of ways."
I haven't reached the point where I try this feature yet, but I bet it indeed saves a lot of time by making the placement of additional ambient lights unnecessary.

"I will say though that it's a shame it doesn't work for switchable lights!"
Hmmm... Eric? Would that be within the realm of possibilities for a future update? 
Styled Lights Bounce 
I'll look into it! It was something I left out initially to keep things simpler. Nice screenshots! 
The "Brush Primitives" Map Format 
Any chance of supporting the "brush primitives" map format (like how we support Valve 220) ?

As far as I am aware, the "brush primitives" format was introduced for Quake 3 engine games, and is supported by GTKRadiant-based editors. It's like Valve 220 in that it allows textures to be projected properly on the brush face, instead of just the coordinate axes. I don't know too much about it, but there's an overview of the various map formats here: 
Brush Primitives 
Should be doable, I imagine I can just grab the code from q3map2. I'll just need to find q3 map sources that use that format to test it with. 
That would be ace biscuits :) It would allow better texturing possibilities for Radiant users, of which there are quite a few here :) 
Like what? Some examples? 
It's just another .MAP texture alignment format equivalent to Valve 220 and Quark ETP 
I think I got brush primitives working - alpha build!

Hopefully radiant can be configured to use brush primitives and quake 1 textures at the same time. I only really tested the texture alignment with a brush primitives map saved with Quark, although I did check that a map saved with the new netradiant can be parsed, so will be interesting to see if this works. 
Next On The Docket 
misc_models and .ASE models
"Brush Primitives" 
Wow that was quick :)

Here's a test map in the Quake3 BP format:

I compiled it with your new build and it seems to work fine, cheers!

So, here's how you set up NetRadiant to use the BP format:

Edit the file located somewhere like here:

All you have to do is set brushtypes="quake3" and maptypes="mapq3".

Then in the editor, go to preferences->settings->brush and make sure the "brush primitives" checkbox is turned on.

Restart the editor. Now, when you are in quake 1 mode in NetRadiant, you will be reading and writing maps in the Quake3 BP format. Everything else is still Quake 1 style - wad textures work fine and all that.

I still need to pester the NetRadiant guy a bit more though. In the test map, I have included a crude terrain ceiling to illustrate the main problem with the editor's handling of the BP map format - which is ironic considering the format was created for Radiant in the first place...

When in BP mode there currently seems to be no way of telling a face to use the old axial projection - it's face projection all the time. Face projection is great to avoid the weird skewed textures on certain angled surfaces that you'd get in quake's original map format, but for stuff like gentle terrain you would almost always want axial projection to get seamless texturing.

The terrain in the map looks terrible because of this. But yeah I just need to pester the guy maintaining NetRadiant to add the ability to choose face or axial projection on a surface.

A little bonus thing you could do that is not important, but might be worth doing, would be to read Quake3's "detail" flag on brushes, as an alternative to using func_detail - this might come in handy for people who want to try converting existing Quake 3 maps over to Quake. 
_shadow Bug? 
Hmm...not sure this is a bug or not, jpegs below:

Func_wall no _shadow: computer_noshadow
Func_wall with _shadow 1: computer_shadow1

See the hard line where the face changes textures at the trim baseboard?

Tried messing with the brushwork and got these:

.MAP: (ya you can guess what this is eventually going to be ;) ) 
Oops. Link Broken. 
I had that happen to me once on a map I was working on, my solution was to reduce the intersection of the brushes as much as possible. So the wall behind would need to be cut to shape around the computer panel rather than having them simply overlap. Try it and see if it helps, I guess. 
I think that bug was fixed in v0.15.7 :) If you're on an older version, updating to the latest should fix it. 
Feature Idea / Request 
So I was messing about with flashing lights and realised that due to limitations of the engine there are certain things I can't do that are pretty simple. Things like having alternating flashing lights (without needing extra trigger/relay entities). Or having a light that has a fade and a flash sequence.

So I was thinking about custom lightstyles. Here is the idea:

A light entity with the tag "_lightstyle" which allows users to have cusom "id" format lightstyles: string value a-z (example: "aallzzll").

What are your thoughts? 
I think something like that could be done in quakec. 
Absolutely Metl 
but that won't apply to vanilla or to AD or quoth, etc. 
read that as "can only be done in quakec" 
Lighting Question 
Phong shading and Deviance are easy to understand as "options" you can exercise in your mapping. But I am a little confused about bounce(radiosity) and dirtmapping(AO).

From my limited knowledge IIRC radiosity lighting is superior to standard Q1 lighting, yes? And if so, would that be considered to be the default choice(standard) for mappers from now on going forward?

Should this also become standard practice in lighting a map, or more still just an option for giving a certain design/artistic "look"?

Both options can provide a pretty significantly different look. Bounce lighting is one that I personally see as almost always desirable, with the exception that it makes it quite difficult to have stark contrasts in your lighting (which you may or may not want to have depending on specific situations) due to the fact that light will, well, bounce! I can't think of a situation where it's made a map look bad, but by no means is it necessary to use if you want your map to look good.

Dirtmapping, in my mind, is a bit more subjective. It certainly helps to add a "look" to your map, although depending on how you tweak the values that can either be very intense or very minor. It's certainly not appropriate for all situations, but taken in moderation I think that it's generally useful.

I think the same really goes for a lot of the modification's ericw has made; yes, they do have a distinct look that changes how the final product uses, but it's generally a tasteful, inoffensive change that most people would take as being an improvement. I mean, compared to coloured lighting (especially when ported back into older maps i.e. the original game) it's pretty harmless, and we've learned to live with the existence of that technology...

Anyway, I'm not exactly prolific enough to have a "default" for my maps, since I have about... 3 to my name, none released, but so far I've always used bounce and dirt with varying settings in my creations. 
Negative Lights For Stark Contrast 
I haven't tested it in a while but I believe you can use lights with negative brightness to combat the horrors of bounce lighting (even though it saves time putting in fill lights). 
ericw: would it be possible to compensate for lightmap seams as described in this paper?

One of those "would be nice" features. 
I tried 0.15.8 a bit tonight. There seems to be problems with lights inside sky brushes or something. Or maybe a problem with very low values for light?

Here's one that seems to have just disappeared.

BJ/MH Light

0.15.8 Light

That light shining through the window is in a sky brush, but just barely. It's almost in the void. The values are light 75 delay 5 wait .02 and the range is set to 1.0 on the command line.

I saw other differences, but that's the most obvious. 
Thanks; I didn't realize regular light entities were supposed to pass though sky faces. Should be an easy fix. 
The thing is, most of them still did. The only one I noticed that didn't was the one in those screenshots. That's why it stood out. Is it possible it got "nudged" into the void?

On the good side, about 10 of the 30 or so lights it found "in solid" actually were old misplaced lights.

Also to note, there was no reduction in marksurfaces using -forcegoodtree. The number actually went up a bit. Using txqbsp_xt always gives a drop of around 1200 or so. 
New Version V0.15.9 
Download here


- light: fix black fringes on bmodels that are touching against the world
- light: light passing through glass lights up the back side
- light: bmodels with "_alpha" < 1 and "_shadow" "1" set cast tinted shadows
- qbsp: support Quake 3 "Brush Primitives" .MAP format
- qbsp: save "_mincolor" for func_detail/group to the .texinfo file, now used by light
- qbsp: performance improvements

To elaborate on the "fix black fringes on bmodels" thing, v0.15.8 had a pretty severe bug where every func_door (or any bmodel) would have black edges wherever it touched the world, like an ugly/broken looking version of AO.

The reason I broke that in v0.15.8 was, I was trying to fix another bug, where bmodels (func_wall, etc.) that intersect the world, or have a face touching the world, would have broken lighting (usually all-black faces). Typical case where this would happen would be a large func_wall window that has a world brush slicing through it (or just touching the front).

So, that bug is back, because the "fix" I tried was much worse (black fringes on all bmodels). If you have a func_wall with black faces / broken lighting, the fix is to manually clip it against the world so it doesn't stick into the world anywhere. I'll see if I can come up with a better fix next version 
Fringe Of Darkness 
That's great to hear, I encountered the black fringe issue before and it is good to know it may be fixed on this release! 
Would it be possible to hit both bugs by having the compiler test if the bmodel intersects or not? Or would that require multiple passes or something like that? (Assuming extra passes would suck, which when it comes to speed they probably would :/) 
Performance improvements - intrigued, my latest maps have been bottlenecked by Qbsp which is wierd since vis always took the longest until recent improved versions. Curious what improvements you've made. 
@Qmaster - performance improvements are from undoing some mistakes I made when C++-izing bits of qbsp (unnecessary std::map lookups). Qbsp could be made a lot faster, though. e.g. Quake 2's is multithreaded.

Pritchard, I'm not sure if knowing if the bmodel intersected the world would help. I think I need to do something like: test whether each sample point is in the void or not, and just not use the ones that are in the void. 
Dumb Question 
How do you do lit liquids? I tried the commandline flags people are talking about here (-litturb etc.) and it just gives an error and doesn't run light. Was it removed or something? 
-splitturb option for qbsp.exe should do it; light.exe will automatically detect this and save lightmaps for the water. Looks like that option is missing from the docs.

Engine support is fairly rare (?) - I don't know what supports it, off hand. 
Engine support is fairly rare (?) - I don't know what supports it, off hand.

So I can "bake" lightmap on the water and it will be still fullbright in some engines, or what? 
So I can "bake" lightmap on the water and it will be still fullbright in some engines, or what?

Yes. There is that one software render engine that mankrip is doing that supports it I think. That's the only one I am aware of.

However, give other engine authors a slap and a tickle in the right place and I'm sure this feature can be adopted elsewhere (it bloomin well should be because it's coolbeans) 
I just checked my Jam 7 map to be sure I was remembering correctly, and Darkplaces supports lit water too, at least version 15:49:13 May 13 2014. Incidentally, I discovered the final version of my map is apparently broken in that engine for a different reason, which is just fantastic, but the lit water works as expected. It's easier to see the effect with r_wateralpha 1, of course. 
Crazy Idea 
All this talk of lightstyles in the AD thread got me thinking...

Say you had a moving object with start and end positions in radically different lighting conditions.

Imagine you could tell the light tool to light this object in position 1, assigning all light on it to lightstyle "x", and then light it again in position 2, assigning the light to style "y".

Then in the QuakeC you could fade lightstyles x and y in and out as the object moved.

Just an idea, but it struck me as interesting that this sort of cheap dynamic light effect boils down to being a compiler thing + a bit of QC.

You could even go nuts and leverage the fact you can have up to 4 lightstyles on the object, so can specify up to 4 different positions to light it in, allowing much more accuracy in the blending as the object moves around.

I may be missing a few "gotchas" but, does the theory sound basically correct? 
there are only 64 lightstyles total, and 32 of them are used by light.exe for switchable lights, the other 32 for "styled" lights (flickering/pulsing) -- of which about 11 are actually used in id1 progs. So I think this would work if you were willing to dedicate 2-4 styles just for that one moving object, and write a quakec modification as necessary to do the proper fading. 
It Is Intriguing 
I guess it would be something that could become an attractive idea when you have situations like in Hrimfaxi's rrp map, where there is a large section of a big room that moves up through several floors.

Wouldn't be worth it for run-of-the-mill platforms and what not, but for big setpiece movers I can see it having the potential to look quite sexy. 
There are 64 lightstyles, but Quake's BSP format only supports 4 different styles per surface.

IMHO, a more practical solution would be to use the "Lit BSP models" feature from the Makaqu engine 1.6 (used to adjust the brightness of the ammo boxes to the ambient lighting) and add an option to make it also work on internal BSP submodels. 
I only suggest the idea because it struck me as interesting that it doesn't need a custom engine.

I'd be happy to use up a handful of lightstyles on a moving room setpiece.

How is the "ambient lighting" determined in Makaqu? 
Cool Idea! 
I think the challenge is working out a standard between the mapper, light.exe, and the QC. light needs to have a copy of the logic for the func_door/train or whatever is moving. Func_door would be pretty easy, func_train would be trickier (unless the mapper marks which path_corner's to calculate lighting at, up to 4 per train?).

Also, things like making sunlight/sunlight2 use a lightstyle other than the default of 0 are certainly possible without too much work in the light tool. Easiest way might be for the mapper to specify a lightstyle number with a worldpawn key like "_sunlight_style" - light would then use that for the sunlight, and know not to assign that style number for a switchable light. 
I guess one implementation could be...

I would suggest light.exe should not need to know how the object moves - it only needs to know the positions to light it at - these could be specified in the map with "info_lightmodel" entities - they would mark the various positions (mins?) of the brushmodel. The info_lightmodel would target the brushmodel (to let light.exe know what to light, obviously), and also specify the "style" number to use. 
your sunlight suggestion is cool.

Question: what happens with bounce light coming off a surface with styled lights? Is there a bounce for each style? 
Mmm - yes the info_lightmodel sounds good.

Currently styled lights don't bounce at all, this was something I limited to make the first version of the code simpler, but I want to support it eventually. 
Yeah I guess bouncing styles would have a similar problem to styles on lights with 1/x or 1/x^2 falloffs: you could propagate styles to tons of surfaces everywhere and it could get out of control.

I think for most styled lights, you won't really notice the lack of bounce, but if you start doing styled sunlight, then I think sunlight bounce would be noticeable and you'd expect it to change like the direct sunlight does. 
How is the "ambient lighting" determined in Makaqu?

Nearly the same as in MDL models, using R_LightPoint and the entity origin, offset by the relative model position.

As for a pure QC + assets workaround... How about this:

- Make one model on origin A (start), and another on origin B (end).

- Set the B model to non-solid, and enlarge it by 1 unit (not 1%) on each direction.

- In the QC code, make the B model follow the origin of the A model.

- Implement code to fade the .alpha of the B model according to how far it is from the end position.

Almost every custom engine supports .alpha, so this shouldn't be a problem unless someone really wants to target vanilla WinQuake/GLQuake. 
Bmodels With _shadow 1 Lighting Problem 
Does light do simplified calculations on bmodels with _shadow 1? I get weird squares of shadows on solids from complex bmodels (in places, not everywhere). Splitting a big bmodel into a few smaller ones doesn't change anything. Any suggessions? 
There have been problems with _shadow 1 bmodels intersecting/touching each other, or the world. The faces that are touching can have artifacts, either black fringes or solid black or other artifacts.

I forget what the current status is, because I've been swapping in and out hacks to try to combat that.. but I'm working on a more correct fix.

Other than that, there shouldn't be any problem with shadows from bmodels. Check your version is 0.15.9, or feel free to email me screenshot/map if it seems like a different bug. 
If the bmodel doesn't touch another solid, the problem should be gone? 
Yeah, if they're not touching the problem should not occur (at least a 2 unit gap. The light sample points are 1 unit above the face, having these sample points blocked is what causes issues) 
that was very helpful 
does "-bounce 1" bounce lights with negative values? 
Negative lights are ignored by bounce 
Hexen 2 Rotating Entities Broken 
The use of an origin brush for rotating entities doesn't work with -hexen2. The origin brush is visible ingame and the brush still rotates around the map origin 
Yeah, there is no origin brush support at the moment.

Current behaviour is (designed for Q1 hipnotic rotation):
If a brush entity classname starts with "rotate_", qbsp looks at the "target" key, and searches for the targetted (point) entity. That point entity's origin becomes the origin of the brush entity.

I'm not sure if that is compatible with Hexen 2 rotation? 
Probably Not 
Hexen 2's is more like half-life, though it uses the "flags" key for how many degrees it should rotate. I think you can manually enter the origin to specify where it should rotate but that doesn't seem to work right in trenchbroom 
Figured Out A Sort Of Workaround 
You can actually manually put the origin in, but you have to place the brush at the map origin or it ends up outside the map.

Kind of a pain to light it properly but it works otherwise. 
lmao that sounds like an editing nightmare 
Tried implementing it, download available on the github issue

It might be handy for Quake too.
Hope I did it right.. if there is a brush in a brush entity with the "origin" texture, the center of that brush is used as the model origin (qbsp translates the model so that point is at 0 0 0, and sets the "origin" key).

Also light no longer cares about the classname starting with "rotate_", if the brush entity has an "origin" key set to something other than "0 0 0", the faces will be translated to that position during lighting (hopefully doesn't break anything?) 
Im Wondering 
Is there a standard for final compile settings? I assume people leave BSP and VIS parameters alone, except maybe -bsp2 for BSP? Is that something everyone uses, or only if the map somehow doesn't compile as a regular BSP? Is there any reason not to use BSP2?

For light, judging by the doc page on Eric's site, I'd guess people use -extra4, -gate 1, -bounce 1, and maybe some -soft? 
Final Compiles 
Yeah, the main thing is to use -extra4 on light; the other tools can stay with the default settings.

-gate 1 is probably fine but it's actually a faster/lower quality option than the default. -bounce 1 is something you want to use from the beginning if you are going to use it, since it'll change the entire look of the map. -soft is personal taste, it will make the final lightmap softer.

Is there any reason not to use BSP2?
It's best not to use the -bsp2 flag unless it's needed so the map will run on the widest range of engines (including vanilla ones). qbsp will print an error if the map exceeds limits so that it requires -bsp2. 
-bouncescale .8 or so? What about sunlight and dirt settings in the worldspawn? 
Tougher to generalize as those are more artistic choices. The screenshots / settings on the website give some starting points, you can also check map sources for ideas. 
I did check out some of the AD maps and was surprised to find very little dirt is used. Judging by the 1000 Cuts screenies I'd expect a lot more dirt, but maybe that's because of the greyscale. Sock seems to use 96 dirt, I'd think an intermediate between 256-512 would look nice. 
Sock seems to use 96 dirt, I'd think an intermediate between 256-512 would look nice.

Sock's 96 dirtdepth is not a bad value actually. A dirtdepth of 256-512 is something that works when looking at a distant shot of an otherwise fullbright map, like in the preview image on ericw's page. For a normally lit map, it means surfaces 256-512 units away will be darkening your target surface, which can just suck all the light out of interior rooms quite easily. 
I know it's probably a good value; Sock chose it. I have no Quake experience so all I have to go on are Eric's pics and various worldspawns. I need to jump in and make myself a test map. 
I prefer to set things like bounce in worldspawn and keep my compilation configuration as "universal" as possible. I just use -extra4 and -soft on my light config, and I usually use bsp2 for qbsp because what current engine doesn't support it, anyway? 
Don't use bsp2 if you don't need it. 
You can use the bounce parameters in the worldspawn? It doesn't say that on Eric's site. 
Yeah, i'm pretty sure. Also, because of otp, i'm only going to release my maps in bsp2 from now on. (Not that I release any maps...) 
Same. I only use in my compilation setup are the ones that can ONLY go in there. Otherwise the rest go in worldspawn.

Actually, speaking out loud, I need to add those to my .fgds. 
Derp. I Meant #668 
I have .fgd with all Tyrutils-ericw options for my JACK setup, should be easy to transfer to TB2 if you want. 
You can put this stuff in the fgd? How are you doing that? 
Open the .fgd with a text editor and add/edit worldspawn fields like you would with any other entity. 
You can use the bounce parameters in the worldspawn? It doesn't say that on Eric's site.

Good spot. Looks like the "Worldspawn Keys" section needs updating 
So Then 
Which fgd are you guys using? I have a quake.fgd that came with JACK and then the AD fgd. 
Dirty Choices 
I did check out some of the AD maps
Every mapper did their own thing and there are some who did not use detail brushwork or utilize lit files. Personally I compiled all my maps in AD with dirt parameters which are setup on the worldspawn so everyone can reproduce the results for themselves.

Sock seems to use 96 dirt
Its dangerous to take that parameter in isolation because the dirt AO system has several parameters which all play key roles in how the dirt is applied. You also need to remember the dirt parameters work with 2 other key systems, architecture and light entities!

I did countless tests with the new dirt AO system and found I wanted a strong dirt in corners that worked with finer brushwork detail. I also only added dirt to strong light source (excluded from all small/ambient light sources) and excluded it from most func bmodel entities.

There are many examples of different ways to setup lights and I would highly recommend anyone to look at Honey by CZG and The Hell that's coming by warrenm because both have source files included.

Honey uses strong point lights with many low fill (delay5) ambient lights and THTC uses many strong fill (delay5) lights for large windows and subtle fill lights for the rest. Both systems have different advantages and both create a different atmosphere. They are both pre dirt AO options, but they are useful for understanding lighting.

The final piece to the puzzle is architecture and in my AD maps I often have _dirt and _minlight parameters on bmodels and certain architecture to correct the overall dirt parameters I use. Its impossible to expect one global setting will fix all light issues and that is why I requested Eric add the ability to all map entities to switch lighting features on/off.

I also recommend everyone stop using the compiler for options and use the worldspawn instead! Why you might ask? Well so that everyone can learn from your source maps and try to understand how you did things.

I usually use bsp2 for qbsp
As I have said to Eric, this parameter should be on the worldspawn, it is really annoying to have to keep switching stuff around for different maps. The more parameters on worldspawn the better.

Which fgd are you guys using? I have a quake.fgd that came with JACK and then the AD fgd
Just edit/update either file with all the extra stuff you want. You can open a FGD in a text editor and cut and paste stuff around. Jack will run an error check on the file for you when it loads up a map, so its easy to spot errors. The format is not overly complex, the AD version should have plenty of examples of how to use the 'base' function and syntax formats for entity key types. 
Back To Front 
I also only added dirt to strong light source (excluded from all small/ambient light sources)
Sorry it is the other way around, I have not checked my parameters in a long time because I just use the same setup each new map.

Strong source lights = no dirt
Ambient source lights = AO dirt

The dirt is excluded from the strong light sources so that you get the hotness effect around lights. Remember Dirt AO will make every surface look darker and make strong lights sources feel dull.

Here is some more lighting tips to think about. 
I also recommend everyone stop using the compiler for options and use the worldspawn instead! Why you might ask? Well so that everyone can learn from your source maps and try to understand how you did things.

That's a really good point. 
Having as many compile settings as possible inside the map file makes it much more portable.

Imagine working on the map on different PCs (cheeky bit of lunchtime mapping at work anyone?) or on different editors, or after upgrading editors.

If as many settings as possible are properties of the map file, then it should reduce the time it takes you to sync up your settings across different environments.

That would be ideal anyway. 
It seems the only ones that ARENT worldspawn are things like -extra/-extra4, -lux, -onlyents... things that arent followed by some sort of value.

is it possible to convert these to be usable as worldspawn as well? 
Well... Not So Fast 
If the idea is that you find a good value and keep it for that map - no matter what sort of compile you are doing - then it's a property of the map and it should be a worldspawn value (sunlight, dirt blah blah)

If it's a setting that you keep changing to do different types of compiles (e.g. fast / final / onlyents /dirtydebug etc. ), then it's not a property of the map, and thus should remain as a commandline switch 
Do -extra and -extra4 gamma-correct when downsampling, or is that even relevant with lightmaps? It is something which makes a huge quality difference when generating mipmaps for diffuse textures. See for something of a discussion. 
Thanks Sock! 
I did countless tests with the new dirt AO system and found I wanted a strong dirt in corners that worked with finer brushwork detail. I also only added dirt to strong light source (excluded from all small/ambient light sources) and excluded it from most func bmodel entities.

I did notice several maps in the ones I've checked out that disable dirt on some bmodels, like func_doors. Why would you do that? Is it just because they move and their lighting changes enough that they look bad?

Just edit/update either file with all the extra stuff you want.

I know how to edit the FGDs, I just figured there would be a "standard" stock FGD that people use, like how everyone uses Eric's compile tools now.

Strong source lights = no dirt
Ambient source lights = AO dirt

So you sometimes apply different dirt setting per-light? I take it that's usually for indoor areas?

Honey uses strong point lights with many low fill (delay5) ambient lights and THTC uses many strong fill (delay5) lights for large windows and subtle fill lights for the rest. Both systems have different advantages and both create a different atmosphere. They are both pre dirt AO options, but they are useful for understanding lighting.

I come from Source multiplayer (TF2, CS) where almost all maps take place primarily outdoors, so we don't really use "phantom" fill lights much since the light_environment and indoor sourced lights take care of most of the playspace. 
Dirty Buggers 
Talking of dirt, I've always felt lights should have optional dirt "falloff" controls.

It struck me when playing around, that I'd want a bright light source to not apply dirt within a certain small radius, and then after this radius, ramp up until it's subject to the full dirt settings. Something like (on the light entity):


Should be self-explanatory, but if not:

From 0 to _dirt_off_radius units, no dirt.
From _dirt_off_radius to _dirt_on_radius, the dirt linearly ramps from 0 to full, and after _dirt_on_radius, it's full dirt.

What I currently do is use two lights in the same place: a bright light with dirt 1, and then a smaller light with dirt -1 so that it stops the immediate geometry around the light looking unrealistically dirty. The suggestion above means you can do basically the same thing but with just the one light entity. 
I'm still trying to visualize what the dirt actually looks like on point lights. It sounds like the light actually casts shadow at its outer reaches, but that doesn't make sense. I'm not at my PC or I'd make a little test. 
I'm still trying to visualize what the dirt actually looks like on point lights. It sounds like the light actually casts shadow at its outer reaches, but that doesn't make sense. I'm not at my PC or I'd make a little test.

Point lights don't "cast" dirt, so to speak. Imagine lighting a level with no dirt, then dirt is applied afterwards as a second pass. This dirt is applied over the existing light, so those lights are said to have "dirt on them".

For lights that have no dirt (dirt -1), I assume those lights are applied after the dirt pass, not before it, so the light can illuminate the dirty creases.

Caveat: the above is a guess, only ericw can confirm whether that's actually how it's done, but I'd be surprised if it's not the case. 
That makes more sense, thanks. 
ericw - is my assumption correct re: 3 passes (1: dirty lights, 2: dirt pass, 3: non-dirty lights)?

If so, where does bounce lighting fit into this? I assume bounce must be subject to dirt. 
@kinn + Sevin 
Yep, the 3 passes explanation is correct.

It's implemented slightly differently, but the result is the same: each light is rendered, possibly multiplied by the dirtmap (if dirt is enabled on that light), then summed.

Also, interesting idea about the dirt falloff. I don't think it'd be difficult to do.

I did notice several maps in the ones I've checked out that disable dirt on some bmodels, like func_doors. Why would you do that?

I'm guessing it's the same reason shadows look bad on doors; the shadow should be stationary when the door opens, but in Quake the shadow moves with the door texture. 
No, there's no gamma correct downsizing, that's something to try! 
I'm guessing it's the same reason shadows look bad on doors; the shadow should be stationary when the door opens, but in Quake the shadow moves with the door texture.

So it's just to lessen the effect? Disable the dirt so the moving shadow is less noticeable? 
Also, interesting idea about the dirt falloff. I don't think it'd be difficult to do.

For me, that would be really lovely as it would cleanly preserve the 1/x^2 falloff characteristics of my point lights, whilst also giving me precise distance control over when the dirt kicks in, as well as simplifying the whole setup. 
Isn't It About Time For A New Map Standard? 
I feel like the introduction of all these new features etc is being held back a huge amount. 
What new map spec do you have in mind? 
Something With Surface Flags For A Start 
From The Rumblings Around Here 
higher def light maps sound like they'd be useful 
Go Map For Q3 Or UE4 Or Whatever The Hell Then 
Higher res lightmaps have been talked about and we actually had an implementation at one point. Turns out they're one of those things that it's nice to talk about but when reality hits nobody really seems to want them. See the comment about "lit2" in the opening post of this thread, even.

This is something that came up a lot when I was doing the original BSP2 design. There is a degree of conflict between what people want and what's practical to implement. One of the overriding design goals of BSP2 was that it needed to be something that people would actually use. It needed to be quick and easy to implement and with a high degree of compatibility.

That's why it doesn't have all of the additional features that people might wish for. If you ask 10 different people you'll get 10 different answers, and any given 5 of those answers will probably be incompatible with the other 5.

So it doesn't have coloured light built-in, it doesn't have 32-bit textures, it doesn't have high-res lightmaps, it doesn't even change the .map format so you can continue using your favourite editor. Implementing it is just a handful of functions and structures and even software engines get to join the party.

That's why it's been successful where previous "let's design a new map format by committee" attempts have failed.

I think that I've a good idea of the kind of map/bsp format that people actually do want however, and I think it looks a little like Q2 BSP but with embedded textures, BSP2 extended limits and a Q3A lightgrid. 
Higher Res Lightmaps 
Yes, what mh said. See here for the start of a discussion on it when it was trialed:

Feedback was rather mixed.

I'm in the "meh" camp. It's funny how, once you start to increase the lightmap resolution, how quickly your thoughts seem to shift to "hmm looks a bit too crisp actually, how can I make this softer?" Heh. 
I'd be curious to know what Fifth is thinking about with surface flags. 
My experience is that people asking for a feature typically have a very specific problem right now that the feature they're asking for would solve.

For example: "can I have high-res lightmaps?" - meaning: "I'm shining a light through some grating and I'm not seeing the detail I'd like in the shadows".

Thing is, they can sometimes get so caught up in the specific problem they wish to solve that they forget about the knock-on effects of the feature they want.

So "can I have high-res lightmaps?" turns into "everything looks like crappy hard-edged Doom 3 shadows".

Fence textures were another example. I was asked could player movement be clipped by sprites, but it turned out that the problem was that sprites were being used for gratings/etc. Fence textures were an easy addition, everything works the way it should, and the end result is more generally useful.

There's more mileage in asking about what you wish to solve than there is in asking about how you wish to solve it. 
More Thoughts 
It's interesting reading my post on higher res light maps. I think I would still be interested in 2x detail (4x at a push) but it would have to be surface-dependent (specific areas only). I think when I did those tests I might have just done it on all surfaces (wasnt needed).

When I said surface flags that was certainly one example. Lots of features have been added to the compilers already that cover functions (_phong on groups, this is done by surface flags in Q2, same with alpha textures and scrolling surfaces). Maybe something that will allow terrain in the future and curved surfaces.

I dunno, I was just riffing ideas tbh. My next mapping projects will not be grandiose ones like with ad_tfuma so I am not in the market for new toys and gizmos just yet. 
I don't think it would look good if a 4x surface was beside a 1x surface. Unless you set things up very carefully there would be quite a jarring effect where the surfaces meet. 
One thing that I would like to see added is a way to project textures at full resolution. I wanted to do that with my noirjam map to get a smooth, natural transition between grass and dirt but was unable to due to the low resolution lightmaps.

I agree with the issues that high-resolution lightmaps raise, but better texture projection would be a nice feature to have. It would be a niche addition though, and like mh said, design by committee rarely works out... 
Sorry I can't get my head around why you'd want to fake texture blending via some kind of textured light projection.

Opening up photoshop and making some transition textures would be by far the best option.

If there was enough demand for proper texture blending, it would have to be an engine thing, perhaps done in a similar way to how Quake 3 does it. 
I got _dirt_on_radius / _dirt_off_radius up and running, if you want to check it out here is a snapshot.

For now the feature is only active if you set both keys, and there is no safety check that the _dirt_on_radius is larger than _dirt_off_radius.

This does seem like a cool feature.. here is an (ugly) screenshot with:

"_dirt_off_radius" "100"
"_dirt_on_radius" "500"

The light is in the upper left of the screenshot, and the dirt is only really visible on the back wall to the right 
@Kinn - Not Necessarily ... 
Blend it manually! tool screenshot results screenshot

I never knew I turned that into a tool, but a month ago I noticed someone talking about that tool.

I guess Spirit saved off a copy. 
Wow :) Thanks, that was fast! I've had a play with it and it makes a big difference - that will practically cut in half the number of lights I need. It looks great - torches in corners and alcoves now look correct, and the dirt nicely fades in as the light diminishes. A great addition imo :) 
I've never had much success with tools designed to blend textures; in general, my experience with working with .wad files has been pretty awful. So far the only hassle-free, bug free experience I have had has been with (our lord and saviour) ericw's defullbright tool, which actually does what it says on the tin without refusing to load half the formats it "supports" or failing to save changes properly...

Quake Texture Tool is nice, but in my experience it mangles the colours from time to time. I had to get some blended textures for my current map made by hand because everything QTT produced wouldn't match up when put next to either source texture.

In any case, projecting/blending textures is a much simpler, less painful experience that can easily be achieved with a map editor and the requisite format support. If it worked like it currently does, all you'd need to know is the names of the texture you want and how to set up a spotlight. No messing around with buggy tools from the 90s/early 2000s and no messing around with things like GIMP or Photoshop. 
@baker - looks useful!

@pritchard - sorry still not seeing it - leaving aside the issues associated with having an uber-high-res lightmap, you're still just projecting coloured light - it will just glow, like a stained glass window effect surely? 
Why would it glow? If you're projecting a texture, not a light, you're not projecting coloured light. Perhaps that's how it works now?

To be honest I just miss being able to paint textures in Cube 2. As far as I know that was done through some kind of "map" of the level, but I don't know the specifics of how it worked. But if you're familiar with that, that's the sort of functionality I'd like to have. Probably a pipe dream... 
In any case, projecting/blending textures is a much simpler, less painful experience that can easily be achieved with a map editor and the requisite format support. If it worked like it currently does, all you'd need to know is the names of the texture you want and how to set up a spotlight. No messing around with buggy tools from the 90s/early 2000s and no messing around with things like GIMP or Photoshop.

What are you smoking? 
Why would it glow? If you're projecting a texture, not a light, you're not projecting coloured light. Perhaps that's how it works now?

When you project a texture with a spotlight, you are adding positive light to the lightmap. Let's say you project a green grass texture onto some gravel - all that will happen is you are adding some greenish light to the gravel texture - you'll see the gravel texture brightened up a bit and tinted green 
You can project a texture and set up any blend func you wish. Do it before lighting, do it after lighting, whatever.

Just because it's commonly used for spotlights doesn't mean it can only be used for spotlights.

So project a green grass texture onto gravel and set up the blend as GL_ZERO, GL_SRC_COLOR and you get a straightup modulation of grass and gravel. Set it up as GL_ONE, GL_ONE and you add grass to gravel. Set it up as GL_ONE, GL_ONE_MINUS_SRC_ALPHA and set up the alpha channel of the grass texture and you get a masked overlay - kinda like Quake's sky. 
All my comments are assuming we're just using the existing system but with just a higher-res lightmap. 
EricW, Baker, Spike And Other Engine Devs 
So it seems obvious to me that the people who work most on the engines should drive any changes they want to see / would see to be beneficial to the community. So Baker / EricW / Spike... What would you want to see in any future map format?

Regarding the screenshots from the upscaled lightmap experiment.

The jaggies were gone, which was nice... But the sharp shadow edges were a bit much. It seems that some quantity of blending is nice. 
The "jaggies" disappear in regular resolution lightmaps when you compile light with -extra4. 
Lately I've been learning lots of simple shit that I should already know.

Thanks OTP. 
Any changes you make to the map format are useless if noone ever uses them
until them we have bspx, to embed optional stuff that noone else even realises is there. 
So, leading off of my post in the Mark V thread, is there any particular issue with these compiler settings that might cause lit water not to work? 
Aha, should be "-splitturb" without the "s"..
qbsp should be printing an error about unknown option I think? 
-onlyents And Strings 
Really obscure, odd thing that had me stumped for quite a while! Posting in this thread because it seems to be something to do with the compile.

AD mod - create a misc_textbook and just put (for example) "\\bTest Message\\b\\n\\n" in the "message" field, and "\\bTest Message 2\\b" in the "message2" field (without quotes).

If you do an -onlyents compile, the \\b gold lettering breaks and you see the backslash character in the text. If you do a normal compile, then the gold lettering appears properly. Does this happen to anyone else or is it just me? 
This board treats backslashes different when you preview a post versus actually posting.

In my above post, please ignore the double-backslashes.

They are supposed to be single-backslashes (so in my example above I am actually typing single-backslash-b etc. in the message field in the quake editor.

How confusing is that! 
Try doing an onlyents light compile (after the qbsp -onlyents); I think that'll fix it.

the \b handling is in done in light.exe for some reason; it probably should be moved to qbsp. 
That did the trick :) 
Strange Lighting Some of my func_detail gets really dark in the middle and has obvious seams with the nearby brushes. Here's how it looks in the editor:

Any ideas? I can mask the effect by adding another nearby light but the seam is still visible. Changing the geometry works to fix it as well, which is what I've chosen to do. 
Hmm, it's tough to say. It could be a few things:
- try a light compile with "-phongdebug" and set "r_lightmap 1" in engine.
- try adding "-novisapprox" to light. This disables some light culling that can be over-aggressive and can cause artifacts like this, although it shouldn't be messing up in this case. 
I'd also say your geometry is overly complex on the floor. You're more likely to get lighting errors and such when the detail is so high. I'd also say high detail on the floor is not always desirable because of Quakes quirky physics. 
In my experience with the floor so far it's has worked out well, but I could easily change from func_detail to func_illusionary and use flat clip brushes for movement if it becomes a problem.

I'll try your suggestions soon Eric. 
I Wouldnt Do That Tbh 
as you may encounter similar lighting issues etc. Just keep it clean and simple, Quake doesnt need to be super high poly :) 
I like me some polygons, dangit! I'm well aware of the func_illusionary lighting problems, but they all have workarounds and should be minimal in the first place considering my minimal amount of brush overlap. 
Was fence texture raytracing ever re-added? It'd be nice to have, my current map uses such textures quite a bit. 
It's in v0.15.9. It should work automatically (the old version needed a -fence command line flag, which is no longer needed) 
Is it supposed to be reported in this line if it is acting?
Embree_TraceInit: 0 skyfaces 40734 solidfaces 0 fencefaces 0 selfshadowfaces 0 skipwindings

I'm noticing that there are no "fencefaces" reported, which makes me wonder if it is actually working. 
Yeah, it should list >0 "fencefaces" there.
Check that "_shadow" "1" is set on the entity (assuming the fence texture is used in a func_?) 
Now that more people are trying to implement lit liquids, and Darkplaces already supports it, can you turn -splitturb on by default in the BSP compiler?

It has literally zero negative side effects, and the impact on performance caused by the subdivision should be negligible in any engine nowadays.

It's nice that the compiler is already capable of compiling lit liquids, but no one is using this option yet. All of those new maps being released in the last months could have looked a lot better with lit liquids. 
I'd like to see this happen too.

I think there are still a few decisions to be shaken out regarding lit water, but we're not going to get a useful discussion until a sufficient number of people have had a chance to see what it actually does look like, what all the weird corner cases are, and how it interacts with existing content. 
I'm not sure about enabling -splitturb in these tools by default; I don't want to push it on mappers retroactively, which is what would happen if people upgrade tools and don't test their maps in DarkPlaces. In the longer run I think it'll be a feature like skyboxes (or phong shading, bounce lighting, etc) where mappers might use it if they're going for a modern look, and not use it if they're going for a retro look.

But I agree the community in general needs to see this in action to evaluate it; DarkPlaces isn't that useful for evaluating the look because the water surfaces doesn't do the swirl effect. I have only seen it in DP and it looks OK but tends to make water look a bit like a solid wall.. I think the warping will help counteract this (as well as careful setup of wateralpha / minlight on the water brushes, from the mapper). We need a Fitzquake style engine with it. I meant to make a patch to Quakespasm for it some time, at least for making test builds to post here. 
Does Darkplaces have a cvar to disable it? If a map doesn't look good with it, the user can disable the effect.

It's about having options. If lit water isn't compiled into the map, the users have no option. 
DarkPlaces [...] doesn't do the swirl effect. [...] tends to make water look a bit like a solid wall.. I think the warping will help counteract this

Exactly. In Retroquad it looks great because the texture swirls while the lighting doesn't. 
Yeah, I compiled e1m2 with lit water and noticed the "solid wall" effect too, but this was even with the turbulent effect.

Another thing I noticed is that the lightmapping tends to make translucent water less noticeable; it's actually more difficult to fine-tune a good value of r_wateralpha that works well.

The thing about fullbright translucent water surfaces is that they actually blend with the lighting on the solid surfaces below them. This comes back to the statement I made earlier on about translucent surfaces probably not needing to be lit at all, but yeah, it's something that people are only ever going to be able to evaluate once they see it.

Having a cvar to enable/disable options is useless IMO if the cvar isn't exposed to the player somehow. Because most players won't even be aware that it exists. That's a total cop-out; people don't read readmes so you need to pick sensible defaults and unfortunately I suspect that while community judgement on lit water is going to be "it looks crap", people are so drunk on the kool-aid that we're going to end up with a set of defaults that in a years time nobody will want. 
To me the value of lit water is that even if it is a tradeoff of sorts and can have undesirable effects (I still haven't really managed to see it in action aside from screenshots, so I can't say if it makes water look like a solid surface or not), it's still better than having water that glows in the dark.

That's really what it's about for me - letting mappers use water in dark areas without it looking awful and out of place. The way it is right now looks fine in places like this, but not so much in places like this. You can make it more subtle by increasing wateralpha (it's 0.6 in these screenshots), but then you lose some of that murkiness and uncertainty from the water that a mapper might want. And it doesn't solve the problem completely anyway.

By the way @ericw, thanks for the hint about the _shadow key, worked a charm. Too bad my fence textures are too finely detailed and barely let any light through :( 
mh: Having a cvar to enable/disable options is useless IMO if the cvar isn't exposed to the player somehow.

That's why I'm used to implementing menu options for this kind of thing. And such menu options needs cvars.

Lots of engines have options to toggle colored lighting, wateralpha and so on. It's really hard to believe you haven't thought of this possibility.

Anyway, even if nobody else implements it in their engines, even if nobody else compiles it in their maps, I'll just keep doing my own thing. Even if everybody else thinks it looks bad. 
I think Retroquad looks great but i also think it should be a criminal offense that I can't play it ;-; 
Clip Brushes Question 
Let's say I have a lot of fiddly little clip brushes used to smooth over some terrain (turning the collision into steps basically, not slopes). Should the clip brushes be made func_detail, like the terrain, or should clip always be world / func_group, regardless of how detailed it is? 
I Don't Know About Quake 
But in Source clip brushes don't cut visibility. 
I used to place small brushes in func_wall, but for vising sake it would be func_detail. 
Clip Brushes 
I'm pretty sure it's fine to put them in func_detail, they will behave the same as if they are in worldspawn or func_group.

(Clip brushes are only included in hull1/2, and func_detail is specific to hull0, so the features shouldn't have any interaction) 
Thanks very much, that all makes sense. 
3 Questions 
1) If I want to upgrade to the latest tyrutils-ericw (v0.15.9) on Linux 64 bit, can I just download the archive, extract it and immediately use it? That's what I tried, and qbsp seems to work ok, but light gives me the error message
error while loading shared libraries: cannot open shared object file: No such file or directory.
There is a file called "" in "tyrutils-ericw-v0.15.9-Linux/bin/", though, so I'm confused.

2) When using running light, does it matter in which order I type in the command-line options? E.g. is there a difference between
light -bounce -extra4 -dirt
light -dirt -bounce -extra4?
Are they both correct? Or both wrong? Do I need to give "bounce" a value? (I've tried various variations, but I find it hard to know when/if I'm doing things correctly, as I'm not sure what the in-game results are supposed to be).

3) This is not a huge problem (yet), but one brush face in a map I've been working on suddenly stopped being lit, both when running light normally and with "-dirtdebug" (which should light all faces evenly, right? That's what it's always done before when I used it). Is there a known reason for this kind of thing? Is there anything one can do to avoid it, or is it one of those mysterious things that just sometimes happens?

This is using tyrutils-ericw 0.15.8 and an outdated version of TB2 beta (the reason being that when I last tried to upgrade TB2, I seemingly had to first upgrade my then freshly installed OS, or fiddle around with repository settings to get the necessary dependencies updated to the versions required for updating TB2 -- and I didn't have the time or patience to do so. At some point I will update both). I just mention this in case this might be an issue related to the editor rather than the light tool (in which case I'll just have to live with it until I update my OS and editor). Oh, and my engine is QuakeSpasm 0.92.0. 
1. Looks like I messed up packaging the linux binary.
If you don't mind running light manually from the terminal, try "cd"-ing into the "bin" directory and run:
LD_LIBRARY_PATH=$(pwd) ./light {options here}
Otherwise, I'll fix it in the next release.

2. Order doesn't matter, except the map has to come last. There is no parameter for -bounce (there are separate flags like -bouncescale X though). Only a few commands take optional parameters (-soft can take a number like "-soft 2"). The tool should be strict if there are mistakes in the command line options, and refuse to run. For now the manual is the best reference: here, or the website front page.

3. It would just be a bug in "light". Things that have caused black faces in the past:
- bmodels (func_wall, etc.) that intersect the world
- regular world faces with an obstruction near the center of the face, within 1 unit of the surface.
I *think* I fixed all of these for the next version, I should put up a beta or release soon. Feel free to send me your map/bsp if you want me to check it out though. 
Thank You Very Much For The Response, Ericw 
1. I didn't know there was an alternative to running it manually from terminal; that's what I always do. :) Anyway, I tested typing that arcane string of characters and it works, thanks! That'll tide me over till the next release.

2. Order doesn't matter
Thanks for clearing that up! :)

There is no parameter for -bounce
the manual is the best reference
I had already read through the manual and the stuff on the front page a few times, but was still a little confused.

The example of the front page is
-bounce -bouncescale 2
which made me think that it doesn't take any parameters.

But the manual made it seem to me as if do need to specify a value ("n"):

bounce n

Enables 1 bounce, 0=disable even if set in worldspawn. Available as a worldspawn key.

I guess I'm misinterpreting something?

3. Thanks for all of this info. The brush with the unlit face is just a regular unobstructed worldbrush, but it's good to know these things for future reference.

Thank you very much for offering to look at the map. If the problem persists, I might take you up on the offer, but a lot is bound to change in the map, so the problem might resolve itself in the mean time. Plus, the file is a huge mess of provisional brushwork, newbie mistakes, textures that have not been properly aligned yet, etc., and though I know no-one but me cares, I'm still too embarrassed to share it in its current state. 
Intensity Of Color Lights 
I noticed that color lights have different intensity than the neutral ones. In the picture all the lights have the "light" key of 150, but the attenuation and the intensity is very different.
If that's "a feature", what can I do to make them look more uniform? 
That looks like a custom engine screw-up. What engine are you using? 
When you change the color, it reduces the intensity of the colors that you don't want. If a white light has RGB color of 1, 1, 1 and you make it pure blue, the color becomes 0, 0, 1.

You could reduce the brightness 1/2 by making the color 0.5, 0.5, 0.5

I don't think the light program compensates for this and maybe it's what you are seeing. 
That's not the problem at all here. Look at the image - that's an engine thing. The light program just can't blow the lightmap brightness up like that. 
Okay, you're probably right. The picture was so dark I couldn't really see anything other than the white and blue blobs, and I was too lazy to turn the gamma up. 
White and colored lights shouldn't have vastly different intensity / falloff, and if anything white will be brighter than colored as Rick was saying.. so something is wrong here.

Is the "_color" key set on the white lights (the dim ones on the right)?

The engine's brightness/contrast controls are blowing out the colors so it's hard to tell what's going on. Also assuming that is Darkplaces, you can view the lightmap only by entering "gl_lightmaps 1" in the console. 
It's clearly amplifying the light instead of reducing.

Somehow, it seems to be adding the color to the light instead of multiplying. 
Ericw's Right 
It's Darkplaces. Only the color lights have "_color" key. I'm at work right now but AFAIR I didn't use any "_deviance".

If anyone wants to check it, I could take more screenshots with higher brightness or should I mess with any other parameters?

I'll check the same settings in FitzQuake and will let you know. 
Use floats, ie values between 0 and 1.
Values greater than 1 will either oversaturate or be divided by 255, depending on implementation (welcome to the wild west).

The lighting in that screenshot actually has nothing to do with tyrlight[-ericw], because the engine you're using is basically ignoring its output and making up its own thing based on the map entities.
set r_shadow_realtime_world 0 to get it to behave properly. This'll also boost framerates significantly, so a double win...

ericw, how about a feature to ignore/strip certain lights so you can more easily set up rtlights without damaging static lights? maybe 
Ah Yes, Darkplaces 
Loathe as I am to suggest continually adding fudges to support all the different implementations custom engines expect - on the compile side, would it make sense to always normalise 0-255 values into 0-1 values when saved to the bsp? 
Fgd File Updated 
I've updated my FGD file for version v0.15.9 of Ericw tools so you can now set phong on brush models and projected textures on lights.

Tested with J.A.C.K steam release 
Thanks Daz! 
Spike, ah, rtlights explains it. Hmm maybe a key to omit an entity from the bsp could be handy, although in this case the mapper could just use colors values in 0-1.

I kind of hate to add hacks like scaling the "_color" values in the bsp to 0-1, although I suppose it improves compatibility with darkplaces "auto-rtlights" and should be pretty safe. 
Floats Do It! 
Thank you Spike! As soon as I changed the values into floats, the light got rendered nicely.

Also, when I turned off rtworld, as suggested by EricW, the rendering was pretty close to how FitzQuake does it. Although, I do have to admit it, it's a bit bland this way.

If anyone wanted to check a poor presentation of the above, go to 
Face->numpoints > MAXEDGES (64) 
Got this error when working on my map, after I made a brush that was way too finely curved for its own good. Is there any solution other than just having rough edges? :( 
Csg Split it into several smaller brushes? 
More than 64 verts will crash most Quake engines, since engines also contain code that assumes that the max verts in a face is 64. Example:

So you definitely want to keep the tools error and correct your brush instead. 
Can't the BSP compiler split such brushes automatically? 
New beta:

Has the .map conversion feature in qbsp, so you can do:
qbsp.exe -convert valve
and it will write out a copy of the map in Valve 220 format to It can also convert to "quake", "quake2", "bp" (quake 3 brush primitives).

I labelled it "beta" because it's not tested enough, light has a large change to how sample points are positioned. (so unexpected black faces should never happen any more, e.g. this
My God 
so unexpected black faces should never happen any more  
at least one of the causes is gone. 
I think you may have added in a cause:

Also, would it be possible to turn off the bouncing for styled lights with an option? It's causing a lot of "too many lightstyles" warnings on my map.

In more positive news, converting my map seems to have gone off without a hitch! :D 
So it's the black artifacts around the floor tiles? Was that shot with -extra4? I should be able to reproduce it.

re: bounce, good point, it should be opt-in, I guess. "_bounce_styled" "1" worldspawn key?

Thanks for testing and glad the .map conversion worked! It should be pretty trouble free because all the brush planes are passed through losslessly. 
No, no -extra4 or soft. I haven't been using those parameters as I test the map. If you like I can create a github issue with the .map and perhaps a compiled .bsp/.lit? I did just try splitting off the problem area into its own map but I couldn't even reproduce the exact lighting I have... 
Sure, or just emailing me the .bsp + .lit is fine too. I was just trying to reproduce it now. 
Also, interesting tidbit but nothing of any real issue: Converting the map to valve format through your tools seems to have reversed the order keys are listed in for TB2. Classnames are now at the bottom rather than the top. Not the case for newly created entities of course. 
thanks for noticing that, should be harmless but I'll fix it! 
Can sunlight be assigned a lightstyle? Thinking it could be cool to fade it in/out via QC. 
Not Atm 
It's really easy to add though, i'll add it after fixing Pritchard's issue. 
Can sunlight be assigned a lightstyle?

Man that could open up some interesting visuals. 
It's really easy to add though, i'll add it after fixing Pritchard's issue.

Cool! Sounds like a good addition

Man that could open up some interesting visuals.

Random dipping of light from clouds in an overcast sky...the strange pulsing of an alien sun...a simplistic day/night cycle (obvs no moving shadows but whatevs, it's not as if you can animate the skybox)...

You could sync up the light variation with some variation in the fog and skyfog settings to sell the effect better.

I did think it might be interesting if it was possible to have multiple different sunlight setups, all on a unique lightstyle (well you'd be limited to 3 I think) - morning, midday, evening - and you lerped their light intensities in QC (along with "night", but that wouldn't be a lightstyle, just an absence of light). But that's probably overkill and the shadows might still look odd.

I'm not really sure what the performance implications are with massive amounts of lightstyled surfaces though. Are there any these days? 
I just looked up how lightstyles work, is there any limit to the length of the string? Or could you actually have a light that took a really long time to complete it's cycle? That would be a lot of letters...

Also seriously? It's done with letters of the alphabet??? 
Yeah, you can set up those strings and have the light cycle automatically, or you can just set a single brightness value explicitly (e.g. say you wanted a slow day/night cycle thingy, I guess you'd want to set up a slow think function and increment the brightness in the think) 
Uhm, how come this QBSP generates a whooping 11k more clipnodes than other compilers on my map?! 
Hmm, I don't remember touching anything related to clipnodes since this forked from tyrutils.

I just tried compiling and it looks like I can reproduce that:

bjptools_xt_290914_phong2: 38011 clipnodes
tyrutils-ericw_0.15.10_beta1: 44953 clipnodes

So it's producing 18% more clipnodes than bjptools_xt. Is that the same kind of percent increase you're seeing / what are the total numbers of clipnodes? 
Around 41% in my case if my math is correct.

bjptools_xt 1.2.5: 27174 clipnodes
tyrultils_ericw 0.15.9: 38372 clipnodes

(Also roughly 700 more marksurfaces with tyrultils) 
Fun Fact 
Hmap2 produces an even higher count: 43601

So it's settled then: Bengt Jardrebb ftw! 
I don't mind using the old txqbsp_xt in order to not exceed the standard marksurfaces limit, but I'd like to use this light.

I was wondering if the problem of light not passing through sky had been fixed. 
Negke thanks for the info, I'll look into optimizing the clipnodes sometime.

Rick: sometimes this qbsp will produce fewer marksurfaces, so try both.

About making ordinary lights go through sky faces, I tried it a while ago and I don't think it's worth the code complexity, and it caused a significant slowdown.

If I added a way to add entities to specify multiple suns would that help? Alternatively just make a hollow box connecting to the window, it should only add 1 extra leaf and a few sky faces. 
Tried latest beta and I receive too many light styles on faces when I didn't on the latest stable version. Going to assume that's with styles now bouncing?

A few notable black faces I was keeping track of are still showing as pure black. Just reporting! 
latest build from here has a bug.
Rotate_object arent lit, leaves them all black. 
i'll look into it. The git master and 0.15.10-beta1 versions of light are half-baked at the moment, I recommend the stable version 0.15.9. 
Light Absorption For Deep Liquids 
When a deep lake full of mud or slime is in a very bright area, the lighting from the outside will illuminate it as if the liquid didn't exist. This is specially true for lakes under open skies with sunlight.

How complicated would it be to implement an option in the light tool for underwater faces to receive gradually less light according to their distance from the water surface?

I suppose it could work this way:
1) If the face is underwater, check if the light entity is not underwater;
2) If the light entity is not underwater, make a list of all liquid surfaces between it and the underwater surface;
3) For each ray, check which liquid surface in its path is closest to the light entity;
4) Calculate the distance from the liquid surface to the underwater face, and use it to reduce the brightness received by the lightmap.

Note: Light entities placed underwater shouldn't be affected by this, because their underwater brightness was deliberately set by the map author.

I think this feature could be very useful, specially in areas with both water and slime - the slime would look more muddy than the water, because the bottom of it would be harder to see.

Maybe this could be implemented through an entity field in func_detail liquid brushes. 
But lava glows on its own. So does slime, doesn't it? 
I don't think slime necessary glows or doesn't glow, though it depends on what kind of slime it's supposed to be...

In Lava's case, you'd never realistically be able to see underneath the "surface" so no one can say if it glows or not :P

I feel like this effect could already be possible with negative lights - those subtract from the lightmap right? You could place a bunch of them underwater and it'd probably be possible to have the desired effect. 
Light Entitys With Negative Values? 
Never knew they exist... 
I've never tried using them myself but it's in the docs. 
I was thinking of Quake 2 where (all?) liquid textures had surface light. So I guess that's actually irrelevant.

Quake's palette shifting effect tends to make underwater areas too bright anyway but negative light would probably still help. 
Attenuate faster if the trace crosses a water surface.

How do you see this working with moving liquid bmodels? 
How do you see this working with moving liquid bmodels?

Let's follow the current standard:
"_shadow" "n"
If n is 1, this model will cast shadows on other models and itself (i.e. "_shadow" implies "_shadowself"). Note that this doesn�t magically give Quake dynamic lighting powers, so the shadows will not move if the model moves. Default 0.

Liquid faces from inline bmodel entities should only be taken in consideration if their entity's self._shadow is 1.

Shadows are, essentially, instant attenuation. Faster attenuation can be considered semi-related to shadows. 
The volumetric water attenuation is certainly do-able; the raytracer is already set up to have side effects when a ray hits certain surfaces.

The latest stable release from last fall has "stained glass" support, i.e. if you make bmodel with "_shadow" "1" and "_alpha" "0.5", light rays going through the entity will be partly attenuated and pick up the color of the texture.

So a simplified version of water attenuation would be not considering the distance traveled underwater, but just attenuate the ray when it goes through the surface. But on the other hand, I can imagine it would look cool to have bright sunlight at the water surface fading to black (thinking of an e1m4 type environment).

Anyway it's a cool idea to add to the todo list. My first priority now is fixing the breakage that Pritchard reported a while back, which I'm making good progress on but kind of a bit drained on tbh. 
"Bit Drained On..." 
That's fine, just know that what you are doing is really really great! There is no going back to the old tools now.

Incidentally, is your light or qbsp multithreaded? I know vis is, which changed light to be my current bottleneck (bounce fun notwithstanding). 
Thanks, appreciate it :)

Light is multithreaded, qbsp is not. Qbsp could get a lot faster, it spends most of its time in CSGFaces checking if each brush intersects each other brush in the map. Quake 2's qbsp is multhreaded.

The main performance tip for light is to avoid using -extra or -extra4 except on your final compile, and also add -gate 0.1 or something to reduce the overhead of delay 2 lights. 

No problem, I can wait. 
Light Diff 
When a map is recompiled, compare its entities with the entities in its previously compiled BSP file, and use the radius of each light to determine which surfaces had their lighting changed.

This way, when recompiling lights, the light tool can simply copy all unchanged lightmaps from the BSP file, and compile only the modified lightmaps rather than recompiling all lightmaps.

Bounce lighting can make this complicated, so I'm not sure if it would be possible. 
I feel like if you're testing within each light's radius to see what brushes have changed, you're already doing a lot of the grunt work for compiling a new lightmap...

It could work for a rough and messy sketch if you were willing to let a lot of edge cases slip through and accept the odd corrupted face or two, but then you invite the possibility of someone releasing a map compiled with that option turned on... 
testing within each light's radius

Only for the light entities that changed. Quite often, it will be only 1 light. 
What I've been thinking of, that's sort of related to that, is making a light preview tool; it would be a small GUI application with a 3d view with WASD+mouselook. You would open a map file and the tool does qbsp and light and displays the result, except the light baking is done on faces near the camera first, and the 3d view updates as each face finishes baking. Then it would refresh whenever the .map file is re-saved. I think this would be pretty sweet. 
yeah, what I have always wanted is a tool that lets me edit the lighting in realtime. I think that a diff-based approach to recalculating lightmaps would be fast enough to make this possible. Most edits would only affect one light, which has only local effects. Of course editing the sun values would not be as easily optimized. 
I'm not really sure what happens if you use old light data on a new BSP, but wouldn't it be pretty broken if you edited the brushwork around a light that hadn't changed. Say you made a ceiling, put a light on it, ran qbsp/light, then built the rest of the room and tried to patch.

I don't know what that would look like but I imagine it'd be quite bad... 
Yeah, that would be quite broken.

There are also complexities around light styles, combining lights with the same style, and packing in new lightdata/updating light offsets, which may in theory require to recalc for the entire BSP. 
Question: Does ._phong work across multiple entities when combined with ._shadow, to make multiple func_wall, func_illusionary, etc blend smoothly with the world's func_detail "entities"?

Right now I'm on mobile and can't test it. 
Pretty certain it does mankrip 
Iirc, separate func_detail / group will be blended if the _phong settings allow it. But other bmodels never blend with each other or world. 
The Cursed Words... 
Having a real time lighting renderer like ericw would be really neat. If you were able to cull light calculations to the player's view (You'd have to be very generous - bouncing their view around corners to find lights that should cast but would otherwise be missed), you could potentially have an engine that displayed in the traditional quake style, while keeping the main benefits of lighting in real time like moving lights.

I can already imagine a whole set of horrendous edge cases arising from this sort of thing, but it'd be a pretty neat thing to see and something that I'd hope modern computers would have the power to pull off... 
I have ZERO issue in paying for a light preview tool to be created. Even if its separate from TB. 
Mapper's Most Wanted List 
�WYSIWYG Editor (lighting, models, anims, particles, the works)
�Leak indicator light: red dot on status bar means leak, green means you're good, updates in realtime during editing. (Plus toggleable prt lines, yes this is same concept as lighting preview)
�Auto entity naming and quick linking/pathing (JACK is pretty good actually)

In earnest, having a simple little window with a 3D fly view and a button click to "render", even if it took about 20sec, would be an awesome help to have over on my 3rd monitor.

sleepwalkr might be able to integrate something into Trenchbroom's 3d view if you mocked it up.

Go for it ericw! Would make adding all the nifty features easier, such as testing phong or bouncescales. 
Yeah, I've just tested, and it doesn't work:

The back of the column is a func_detail with _phong 1. The front of the column is a func_wall with _phong 1 and _world 1.

If _phong 1 worked on mixed entity types with _world 1, we could work around some of the BSP's planar/vertex accuracy limitations by alternating between func_detail and func_wall brushes. This would make the engine clip their planes at the rendering level, which is completely accurate and doesn't produce distortions. 
#821 @mankrip 
quake's lighting logic has some bias on its dotproducts that increses the amount of light on surfaces that are nearly perpendicular to lights (which is important for lights placed near said surface).
You can disable the effect with _anglescale 1 (I think it is now - vanilla hardcoded it to 0.5)

the '_phong' key simply calculates surface normals on a per-sample basis instead of per-surface (thus meaning its misnamed as it doesn't change the lighting formula). It affects the lighting, but not the shadows. While it would be possible to push the sample worldspace positions according to the same calculated normals, and determining shadows based upon those, such things would be quite unreliable in practice - for instance, a concave surface curve would logically push those sample positions inside the surface, which would result in all traces being obscured with the surface shadowing itself.

so yeah, that's why you get sudden lighting changes on the edge of pillars - because -anglescale is biasing the light on one side while the other side is in pure shadow.

if you want to try it anyway, this is the maths I use in FTE for tessellation:
vec3 w = p0*bary[0]+p1*bary[1]+p2*bary[2];
vec3 t0 = w - dot(w-p0,n0)*n0;
vec3 t1 = w - dot(w-p1,n1)*n1;
vec3 t2 = w - dot(w-p2,n2)*n2;
w = w*(1.0-factor) + factor*(bary[0]*t0+bary[1]*t1+bary[2]*t2);
you should be able to shove something like that into GLM_InterpolateNormal (and convert from glsl to cpp - I already renamed stuff from glsl). You'll then need to return the smoothed position back through multiple callers to the point where its copied into the lightmap samples array.
Bonus points if you can calculate the barycentric coords (read: interpolation weights) for general polygons instead of just triangles.
like I say, you'll need to clamp the shadow-point to never be behind the surface to avoid the more obvious glitches. once implemented properly you'll get smoother lighting around corners (although due to the nature of traceline shadows, it'll probably still be somewhat sudden without anglescale 1). 
@mankrip, smoothing between separate models is too difficult to attempt, imho, because smoothing relies on the model having been processed by QBSP. i.e. it involves walking around the mesh (exploring neighbouring faces to a vertex, and neighbouring faces to a face, etc.). If the models weren't clipped against each other, the smoothing wouldn't work.

@spike in current git, I wiped out the "traceline to position sample points" thing. Instead I'm trying to use the same code as phong shading, so exploring the mesh by following connections between faces. So in a concave surface, it should work properly and give world space positions that are consistent with the interpolated normals.

Only problem is, it needs some more work.. Pritchard's case in #773 was failing because of t-junctions in the bsp. I want light to work properly if qbsp didn't add t-junc vertices, so I'm making light do it (in memory only).

re: GLM_InterpolateNormal, apologies for the current mess I made in the code and weird names.. I tried using the glm library a bit, then decided I didn't like it. (100 layers of indirection/ abstraction for basic vector operations, slow as hell debug builds,..)

On the plus side the test suite is growing slowly. 
Is there an automated way to import the configuration from the non-Steam version?

I've just bought JACK on Steam, and upon launch it didn't detect that the non-Steam version was already installed. 
Dumb Me! 
Wrong thread. Wrong tab.

Anyway, thanks for the explanations, ericw and Spike. I'm already going to implement something which should serve as a partial workaround, but I'll keep this info in mind for future research. 
Quake's dotproduct is a simple dot(L,N) * 0.5 + 0.5; i.e a rescaling from -1..1 to 0..1 (excluding the spotlight cutoff for simplicity):

angle = DotProduct (incoming, l->facenormal);
angle = (1.0-scalecos) + scalecos*angle;

But scalecos is 0.5 (, so substituting:
angle = (1.0-0.5) + 0.5*angle;

And evaluate (1.0-0.5):
angle = 0.5 + 0.5*angle; 
Fence Volumes 
Is it possible to make brushes with fence textures be compiled in a similar way to brushes with liquid textures?

By that, I mean making them become properly see-through. Currently, any brush with fence textures will clip any polygons from other brushes that touches them, which results in open holes where the other brushes should be visible.

The only difference to liquid textures is that the pointcontents of fence brushes would have to be set either to solid or to empty. I guess the first case would give problems to the renderer, and the second case would give problems to the physics, but from the top of my head I'm not sure. 
I'm not sure how much interest there would be in changing how fence textures are compiled as it's already quite easy to resolve the "clipping" by making brushes using fence textures be a func_ brush such as illusionary or wall. 
Lighting Artifacts 
Pic. What's going on there? Any way to get rid of this without anglesensing the shadows from the spikes away? 
Apparently it's related to the increased texture scale (2.5-3x). Jury-rebbed BJP light doesn't seem to have a problem with it (but it lacks several feature I require). 
Make sure to use v0.15.9, the .10-beta1 turned out to be broken.

If that's not the problem, I'm not sure from the screenshot, could I have a look at the .map (just for what's in the screenshot would be fine)? 
There's a specific problem I'm having with it, when BSP entities partially inside of walls gets darker edges because part of their surfaces is in pure darkness.

If such entities were part of the world, their surfaces would be clipped by the compiler and there wouldn't be any parts of them in pure darkness. But to be part of the world, they would have to be compiled similarly to liquid volumes, without clipping other brushes.

Currently I can work around this by making the other brushes that touches them into func_wall entities too, but IMO this isn't the most efficient approach. 
the renderer doesn't care if something's solid or not, just that its a leaf or node.
same with physics, really.
just make sure those fence-solid leafs don't get merged in to leaf 0 like all other solids, and that vis considers them transparent despite solid (can't say I've really looked into the vis tool itself, maybe it already goes by leaf 0 instead). 
Thanks for the explanation. The BSP tree architecture is something I've not started studying deeply yet. 
Devil In The Detail 
I also came across an issue with detail brushes. Not sure if it's a bug or simply a technical restriction and downside of the way detail brushes are done in Quake, and also not sure if it's a general thing or only applies to certain special cases.

I had a compact bit of architecure flush to the wall of a building and turned it into func_detail in order to use phong shading on it. The building's wall behind it remained solid world geometry. As it turns out, having the detail brush touch the wall like it did caused the compiler to disregard visblocking for the wall which resulted a situation where a large part of the interior was being rendered despite being completely out of view, causing wpoly to increase by 1500. Making the func_detail 'flatter' by including only the front part of the detail architecture didn't change anything; it seemed to be entirely related to the touching of detail and world brushes on that particular part of the wall.

Now, this might be an edge case caused or faciliated by the shape and construction of that particular area (sloped brushes, same brushes for inside/outside etc), but still a potential risk to keep in mind, especially if remaining unnoticed until the final release of a map.

If anything, this is meant to raise awareness that excessive func_detailing can be detrimental, too. Perhaps the code can be tweaked to make sure this can't happen, or maybe it something to live with due to the hacky nature of it. 
Some screenshots to clarify.

The face is the func_detail in question. The wall below is a door, but instead of only rendering the corridor behind it (hell knight), it even draws the atrium way out sight, much of its upper and lower parts. 
isn't a catch-all.

I have found in a number of my maps that I get a speed gain in compile times but not always ideal results in culling in the game. 
That Face... 
Is so Tron. 
Tyricutils Func_detail 
Good lighting and faster vis time and same, worse PVS splitting.

Source engine func_detail: Good lighting, faster vis time, and clean PVS since it treats them as func_walls.

Thing is, I don't know how you would gain the benefits of true func_details (the Source way, the right way) unless the compiler turned them into info_notnulls or func_walls. Otherwise, the mod would need to support func_detail entity in its progs.dat


Unless engine support for func_details was added. Currently the compiler de-entity-ifies them into normal brushes. But if they were kept... 
What you describe about detail brushes in the Source engine sounds close to my suggestion about see-through solid volumes. 
Isn't all VIS/PVS data precompiled in quake? Why do we need to turn brushes into a specific kind of entity in order to get a desired effect?

Would it not be possible for VIS to just look at a func_detail, say "I'm going to treat this as if it were a func_wall" and be done with it?
How does it work currently? 
Yeah, I'm going to take another stab at fixing func_detail's PVS issues. mankrip your suggestion sounds good to me, and it sounds like it'll share the same implementation.

How about (assuming I can get these to work :-)

- func_detail_fence - same as "func_detail" but doesn't clip away world faces, so it's usable for fence textures. Like func_wall, but doesn't use up an entity.
- func_detail_illusionary - same as func_detail_fence but no collision hulls. Like func_illusionary, but doesn't use up an entity, and as a downside it would block gunfire. Not sure if this would be useful? 
That's good.

func_detail_illusionary would actually be really useful to simulate crouching. The real ground would be lower, with a func_detail_illusionary ground a little above. Of course, this would affect monsters too, so its usage may be limited to small areas. 
I don't care much about quicker VIS times; all I want to achieve is phong shading and occasinally minlighting on brushes without taking up additional entity/model slots. Although marksurfaces eventually forced me to turn many of them into func_wall after all.

As for the issue I mentioned above, there's a workaround. As it turns out, phong and minlight also work on func_group, so making the big face a group instead of detail gets all the effects without the PVS problems. Good to know, albeit even more hax... 
Is there a way of increasing the lightmap resolution? 
Use A Bigger Texture Than Scale It Down 
texture scale is linked to the lightmap resolution. 
LIT2 (see the opening post) supports increased lightmap resolution and we all went round the block with it a few years ago. No clear community consensus formed.

My own opinion is that it's a poor trade off for hugely increased file sizes, and it doesn't even look as good as you'd think owing to losing the soft edges on shadows. 
It could be useful to add a compiler/worldspawn option to set portal brush contents to CONTENTS_EMPTY, because as it is, using CONTENTS_WATER, portals can't be (partially) placed inside of slime and lava. 
By the way, Quake's episode 4 already has maps with underwater portals. So, allowing portals under slime and lava would bring more feature consistency to mappers. 
Azure Agony 
Used black for its teleport texture.

I think you mean teleport. Portal is something created by vis.

That's not a terrible idea but I think it would serve better as an entity field: _overridecontents 1 or something to that effect. 
Just copy the teleport texture and call one copy *lavateleport and the other one *slimeteleport in your wad file. 
thats brilliant. 
New Stuff 

I've been working on qbsp, and did a rewrite of func_detail to fix the vis problem. The big change is, func_detail no longer seals the map (which makes more sense anyway IMHO). No more of this! (baker's shot of a way-too-big-PVS from some spot in ad_mountain).

Also, I added a bunch of func_detail variants (illusionary, wall, fence) described in more detail on the release page. Thanks for the suggestions, mankrip, and Spike a while ago.

This is still bleeding edge so it's marked as a beta, and I still haven't fixed the light issue you reported Pritchard. 
I didn't think that had ever cut vis. I know it doesn't in GoldSrc/Source. Was func_detail something third-party FGDs added to Quake? 
Yeah it was something added later to the Quake tools - afaik originating in Quest.

It's not that func_detail blocked vis, but certain setups would cause bogus portals (what negke is reporting in #835) resulting in bogus vis results. 
light: styled lights no longer bounce by default, set "_bouncestyled" "1" to enable.

Just want to confirm this means bounce is disabled on id's lightstyles "flicker, pulse" etc.?

Is that set in worldspawn or on the light entity or both? 
Yep, it's for flicker/pulse and also lights that start off and are switched on. The "_bouncestyled" key is on worldspawn and affects all the flickering / switchable lights in the map.

(The first release I did with bounce lighting didn't support having those lights bounce; now they can, but it's opt-in.) 
great. thanks for all your hard work on these tools. 
thanks for -forceprt1 - I was always editing prt file in text editor to load it to JACK :P 
thanks for -forceprt1 - I was always editing prt file in text editor to load it to JACK :P 
Why Is The Win32 Download 
about half the size of the Linux and Win64 versions? 
32 Is Half Of 64 
Oh, Ummm, Haha, Yeah... 
I'm still running a 32-bit system, I didn't realize that doubling the bits would also double file sizes. Makes sense. 
would it increase compiling time if i added "_phong_ to my "func_detail" entry in FGD and thereby all my func_detail? 
would it increase compiling time if i added "_phong_ to my "func_detail" entry in FGD and thereby all my func_detail? 
If "_phong" "1" is set on every func_detail there will be a little overhead, maybe 10% slower, but nothing major.

The main thing I would watch for is unwanted smoothing. The default _phong_angle is 89 which might be a bit high (face normals up to 89 degrees apart will get smoothed together). Check with a "-phongdebug" compile and set r_lightmaps 1 in the engine to see what is getting smoothed. 

- light: add "_shadowworldonly" bmodel key - only cast shadows on world, not other bmodels.
- light: switchable bmodel shadows (requires QuakeC support, see light manual).
- light: accept "_minlight" in worldspawn as an alias for "light"
- light: handle degenerate faces, print out the vertex coordinates

- qbsp: misc_external_map prefab system (see qbsp manual)
- qbsp: don't write unused texinfo
- qbsp: rewrite outside filling similar to q3map
- qbsp: revert change to SubdivideFace which was increasing faces a bit (see 53743dd)
- qbsp: add -expand option to dump the hull expansion to a "", from q3map
- qbsp: add -leaktest option to abort compilation when a leak is found, from qbsp3
- qbsp: fix handling of duplicate planes, which was causing id1 maps to leak
- qbsp: try to get more reliable leaf content assignment (see a910dd8)

- bsputil: --check: print BSP tree heights at the first few levels of the tree
- bsputil: --check: check for unreferenced texinfo, vertices, planes
- bsputil: --check: print number of used lightstyles
- misc: travis-ci now runs qbsp on all id1 maps, the build fails if any maps leak 
Hey, thanks for this!
I was using beta for a while.
Awesome improvements! 
Weren't there changes to how func_detail brushes are handled? My map's more like a sieve now...

In other news, the removal of the Reload pointfile button from TB was a crime. A CRIME! There is far too much clicking involved now.

Do you know if that lighting bug I reported when the beta first came out was ever fixed? It's still an open issue on Github, but flying around my map I haven't spotted anything particularly nasty (by quake lighting standards) 
Don't use func_detail to seal your map. 
DoN'T UsE FuNc_DeTaiL TO SeAl YoUr MaP 
It was never my intention to use func_detail to seal my map. Think of it more along the lines of func_detail sealed my map, so when I ran QBSP it didn't catch the leaks and instead allowed the map to be VISed etc.

Most of the map is actually func_detail. And most of it is capped off with far simpler world brushes to seal it. But I missed a good two dozen tiny corners and gaps it seems, and that wasn't revealed until now.

Anyway I'm sure that's the least of my bad practices when it comes to VIS. Half of the map is in a giant box right now... 
Func_detail Doesn't Seal Anymore 
I know it's a disruptive change, and makes a lot of existing maps leak, but it was necessary to fix the longstanding bug with vis seeing through walls when func_detail is used.

qbsp has an -omitdetail flag now which should make it easier to see the worldspawn leaks in-engine, or hide all func_detail in trenchbroom; hopefully it's not too bad to seal up the leaks.

Do you know if that lighting bug I reported when the beta first came out was ever fixed? It's still an open issue on Github
I think I still need to do some work on that.
However, there are 2 things that will help for now:
- enable phong shading on the ground
- seal the map (the way I have light set up currently, it needs t-junctions in order to find neighbouring faces.) 
A func_ that actually behaves as a func_ now!

Pritchard: ah the box trick. I used that for a section of a map once with a lot of angled brushes. Tsk tsk, pure mapping laziness. ;) 
RE: Prefabs 
awesome! However, why the weird behavior with the entities? Why do you not just simply move worldspawn brushes to worldspawn, and copy over all others? 
Yeah, it's a bit weird.. I guess I wanted to be able to tweak keys/values per instance. So for example you can make several misc_external_map entities that get turned into func_door's, they all use the same external map file, and each one has different func_door settings like "angle" etc. 
Make it optional!

also, I'd assume "angle" gets rotated with the angles key. 
J.A.C.K Fgd 
Updated my JACK editor fgd file for the latest release of these tools

CLICK THE HELP BUTTON on the entity properties window, it explains all the new stuff in detail for everything. Thx :) 
Have you considered putting the compile command line in the worldspawn of the output .bsp?

Consider this scenario:

1) Someone makes a map
2) Releases the map source

But the number of possible command line options is nearly infinite. The author of the map isn't going to remember. So even with the map source, no one would know how to compile the map to produce a similar result.

This has proven in the past to even be a bit of a pita for even the id Software Quake map sources.

/End random thought. 
That sounds cool. I'd like that for Source maps too. 
Started Using 0.15.10 
Thanks for your continued work on these tools ericw. I recently compiled with the new version and I did notice a slightly faster compile time for light. I didn't notice any issues on the map compared to compiling with the previous build.

I posted this screen in the screenshots forum:

The pillar on the right is a bottom half func_detail with _phong 1 and the upper half is func_breakable with _phong 1, but you can see a clear line where they meet. Do you recommend anything to make this look better? 
try reducing the angle so that it doesn't try smoothing the lighting over the caps of the cylinders? this should normally happen if the caps are completely flat, but if they're angled even by 1 degree then the default angle cutoff will be too high. 
Oh yeah, that makes more sense than my idea. I should probably lower the default angle cutoff a bit. The key for that is "_phong_angle" and default is 89.

To confirm it is that, add the flag "-phongdebug" to light, and enter "r_lightmap 1" in the console (for Quakespasm). 
+1 that would be handy. I recommend worldspawn keys for everything except -extra4/-extra anyway, but it would be useful to have a record of what command flags were used (could even add a key for saving the tools version, though that would bloat the bsp by a few bytes) 
I Broke The Universe... 
Ok I tried ericw's methods by adding the new shadow keys, didn't see much happen as the breakable was still darker.

Here is what happens with r_lightmap 1:

I guess you can still see the shadow here. Now these breakables are only a cosmetic part of the map so this is not crucial, and I could just make the pillar a good old detail brush. But if there is an easy way to fix this it would be awesome. 
Pillar Caps 
I forgot to mention, the pillar caps are indeed angled as Spike mentioned, so if that means its something to do with the phong shading, maybe that helps to diagnose this. 
I set the phong angle on the breakable to a lower number 45 randomly, and noticed some improvement viewing from certain angles, but still darker from others.

Should I also change the phong angle on the detail pillar as well, to match the angle on the breakable. What kind of decrease would you suggest? 
Try adding -phongdebug to your light command line, it will compile very quickly and just give you a visualization of the phong shading.

What you want it to look like (with r_lightmap 1) is the pillar caps to be solid and the curved surface of the pillar to be a smooth gradient. It might help to move the breakable to the side so you can see if the phong shading is blending around the cap edge. 
Also 45 is the right value for "_phong_angle" if it's an octagonal pillar, any lower and the 8 sides of the pillar won't be smoothed together. 
I Think Its Fixed! 
Ok here's what I'm seeing with phongdebug added:

After changing all of the breakable pieces and the detail brush pillar to _phong_angle 45 the darker shadowing is gone!

Thank you Spike and ericw. Great help and this map is looking good once again. 
Hi! I've added a "_falloff" light property. It allows to specify light diameter in map units (this decouples light brightness from light falloff). 
That's a feature I think a lot of people would want. Does brightness increase with light diameter though or does it stay the same? 
It stays the same. 
Sounds Really Good 
I hope it gets implemented.

I imagine you can make very bright spotlights on floors too with this. 
Agree with Fifth. Sounds very useful and more control of any attribute is always welcome. 
Better Than Having To Calculate From Wait 
PS I like your star ceiling Redfield. 
Hi! I've added arghrad-style sun setup using light entity.

Allows to set most of sun properties using a light entity with "_sun" key set to 1.
If the light targets an info_null entity, direction towards that entity sets sun direction.
Light itself is disabled, so it can be placed anywhere in the map.

Following light properties override corresponding worldspawn properties:
light -> _sunlight;
mangle -> _sunlight_mangle;
deviance -> _sunlight_penumbra;
_color -> _sunlight_color;
_dirt -> _sunlight_dirt;
_anglescale -> _anglescale.

Here's a compiled version (x86 build, also supports "_falloff" property I've added earlier). 
Cool. I will try this on the stand-alone version of my SM179 map. I was very displeased with the sunlight and didn't have time to tweak it as it was a 24hr jam.

MaxEd Is there a default falloff for the _sun entity or is it 0? Will pointing this to an info_null effect the falloff? 
Is there a default falloff for the _sun entity?
The default falloff for the _sun entity is 0.

Will pointing this to an info_null effect the falloff?
Thx Again 
I merged in features, _sun and _falloff (only for delay 0/linear falloff for now) 
Will pointing this to an info_null effect the falloff?

Actually, that's a neat idea for spotlights, so I've added that:

Added "_spotlightautofalloff" worldspawn key. When set to 1, spotlight falloff is calculated from the distance to the targeted info_null. Ignored when "_falloff" is not 0.

Calculated falloff = [distance from light to target_null] + [cone radius at target_null]. 
Sorry for such a newb question but are there binaries for this version? or is it just added to the code at this point? 
What Is The Point Of External Map Prefabs? 
Not trying to be a smartass but... if you have a prefab map with brushes you want, why not just open that map and copy them into your current map?

I mean mapping like that seems clumsy and complicated. You won't get a visual in editor and more than likely it'll be trial and error going into the game back and forth to make sure your key settings are correct.

What's the advantage, what am I missing? 
You can make a change to the main prefab and it carries over into all external uses of it.

Copy+Paste means youd have to manually change each instance. 
I am guessing but I think ericw is trying a sneaky way to get prefabs added to Trenchbroom someday. SleepWalkR has resisted adding them to the editor for his own reasons and this is a work around that could be added to any editor in theory. I assume with very little work.

Again I am guessing... or day dreaming. I copy and paste just fine using TB2 but it would be nice to treat the prefab as a group without having to define it as a group. I dunno. Maybe I am just missing something here myself. 
duh... what muk said: that too!! 
One of the advantages of it if you're stuck with vanilla .map format is, you can rotate the prefabs at weird angles that would normally require valve map format to keep texture alignment, and the texture alignment will not get messed up.

along the same lines, you can map something complex in the prefab file, keeping it on-grid, then rotate the instance off grid, then go back and make further edits to the on-grid prefab file. 
Thanks Guys 
I knew I just had to missing something. Seems it was alot of somethings! 
@ericw : "_mirrorinside 1" 
When you mentioned you added this did that means it's already in the binaries for use/download? 
I didn't do a new release yet, but there are dev build binaries here that have it (click on x64 or x86, then go to the "artifacts" tab). Only gave it a quick testing but it seemed to work fine. 
Oh Cool... 
Muchas gracias :) 
Ummm, Actually... 
With DarkPlaces I have no z-fighting with "_mirrorinside 1" set, everything looks fine.

But with Quakespasm there is z-fighting, from both the outside looking in and on the inside.

Was I supposed to make sure the brush doesn't touch other brushes? 
I think you need to make all of the faces "skip" except for the water surface. Qbsp doesn't clip bmodel faces against the world, so that's the cause of the z-fighting.
(in the past you had to use "*waterskip" as the skip texture for water brushes, or you'd get "Mixed content" errors, but with my qbsp you can just use regular "skip") 
*waterskip Not Necessary?? 
Is this the same for *lavaskip? 
you can just use skip 
Ah, Got It. 
But another question, hehe... sorry :(

I think this is a side effect/limitation of the QCat play here, but items or brushwork inside the "water" don't have, hrmm how to say this... correct perspective? Does that make sense. They just look strange.

I've seen this before but can't remember what it was. 
I think it's a limitation of the QC; if you run it in an engine that has the swirl effect underwater like winquake, you don't get that with func_water, you only get the screen tint. I dunno if func_water is messing with the fov cvar or something? 
more of an engine limitation in that the vanilla engine doesn't bother to check submodels for pointcontents, both in the physics+qc builtin as well as clientside too.
(you also need a qbsp that doesn't claim water to be solid, along with generating inwards faces.)

one of the ladders mods has something like 3 different glitches relating to said mod's ladders (breaks at certain framerates, leaves players stuck in walls, etc.
so watch out for that. 
Is there any risk in using the 0.15.9 light binary with the rest of the 0.15.10 release? I've posted screenshots on the mapping help thread and github showing my reasons why.

Having all the qbsp improvements from 0.15.10 would be nice, after all... especially the func_detail fixes. 
It's Safe 
The only problems would be stuff like: func_detail_illusionary will always cast shadows, and func_detail_wall would cause lighting issues if it's covering world geometry.

I would go for it; the func_detail fix in .10 is worth using.

Sorry I haven't fixed this earlier, also noticed some light seams in shib1.bsp that are probably coming from 0.15.10. Fixing the code or reverting the relevant parts will be my priority for the next version! 
_minlight Being Ignored? 
Getting Your Christmas Jam On I See 
That's Messed Up 
let check if I can reproduce it 
I couldn't reproduce it. tried both 0.15.9 and 0.15.10's light. Mind uploading a sample to github? Hopefully this should be a quick bug fix. 
Emailed you a .map and .bsp/.lit

And yes, this is for the Christmas Jam :3c 
Sorry For The OT, But 
if you look just below your pic in the first link, there's a pretty badass fan art of Vader slaughtering Ewoks. 
Does _mirrorinside 1 not affect {fence textures? It's not working for me. Do I need both light and qbsp, I'm only using the qbsp from version 0.15.10 
It's not in 0.15.10, I posted a dev build link in though #910
Should work on fence textures 
Still didn't work. 
@Qmaster: Worked For Me. 
I had func_detail_fence, skip textured all sides except for 1, which had the AD vines.

Saw them from both sides. 
Would it be possible to have model->geo baking like q3's misc_model(static) 
I've played with that in the past, but I didn't understand QBSP as well so it didn't work very well. It's probably doable to bake in a model without converting it to brushes, but it would be illusionary only (doesn't stop bullets, no collision) so I'm not sure if it's worth the effort.

If you want collision (player / monster / bullets) qbsp needs brushes, so you can use obj2map or something to convert to .map first (turning triangles into tetrahedrons with obj2map will probably give you a bloated / inefficient bsp, though). 
Do I need to use func_detail_fence only? I've been using func_illusionary. 
no, I tested it with func_illusionary. I don't know why it's not working for you, check spelling? "_mirrorinside"
Build version should be "tyrutils-ericw-v0.15.10-12-gd86913a" 
Func_illusionary Also Worked. 
No, not func_detail_fence only.

When I first tested I used func_illusionary and then thought, "Oh wait, he mentioned fence!" So my brain connected dots that weren't there :(

What didn't work for me was standard func_detail and func_detail_wall

"but it would be illusionary only (doesn't stop bullets, no collision) so I'm not sure if it's worth the effort. "

Still worth it, imo. 
I think I figured out my shadow bug on my trees - it was the old "intersecting brush with func_illusionary" bug.

My trees have a little solid brush in the center as a "trunk", and making it into another func_illusionary seems to fix the issue.

Still, having a fix for that bug would be nice... 
Hang On 
Turns out it wasn't compiling with the ericw qbsp at all in either version. I usually just hit yes whenever JACK warns me that prt wasnt made since I know my test map isn't sealed.

Not sure what's up. The output says almost nothing to the compile dialogue. Just says the compile path and path to file which are correct and nothing else.

Do I need any sort of compile parameter to compile 220 map format? Already tried the usual admin privileges. 
Ya going back to tried and true txqbsp modified by mh and it compiled just fine.

Hmap2 Works Too 
Does anyone else have trouble with using JACK, valve 220 format, and the tyrutil's qbsp? Light and vis work fine for me but not qbsp. Qbsp produces nothing and gives no output. Must be something wrong with my setup but not sure what. I'm not seeing anything obvious in the docs about compiling for 220 .MAP format. Sorry for the multiple posts but this is wierd and I really want to be able to use all the awesome features ericw has added. 
Hm.. there is no special flag for compiling valve 220, it should just work :/ 
Just Work (c) 
Got it. Mirrorinside working too!! Yay! I manually draggedndropped the .map onto qbsp amd it gave me a couple errors for missing dll's.

Needed to download:

And put into same directory as qbsp.exe. I guess it has to do with Windows 10 missing some VisualC packages. 
Experimental Build 
Is giving me some wierd gray patches where walls aren't getting drawn...tried changing the brush work significantly with no effect. I can send you my .maps if you'd like? 
Sure, I can check it out. 
Pics included to show the problem spots. Let me know if you can't find where they are. 
This is awesome. 
Error Message Related To -bsp2 Vertices? 
Hey there,

My next map is approaching completion. I'm working on the beta build and just recently encountered a few errors when compiling that seem to have been alleviated with the use of bsp2 format.

The first time unfortunately I did not record entirely but it stated something such as: Error: " many vertices... try compiling with bsp2..."

Now this was most certainly not a leak. The map is sealed, there are no warnings of entities exposed to the void, no pointfile, etc. and using bsp2 fixes the problem. When I compile now with bsp2, the map compiles with vis and all is good.

However, I cannot replicate the original error message. If I remove -bsp2 the compiler reports error:
" Q_assert<v1 == edge->v[1] & & v2 == edge->v[0] failed."

Using bsp2 gets rid of this error as well and all is good. Now, I'm not sure what this error is, but the first message was a lot more useful and allowed me to fix the problem on my own, which is great. Maybe this error message should say something similar.

Backslashes Missing Sorry. 
The error reads:

"13:C:\projects\tyrutils-ericw\qbsp\ Q_assert<v1 == edge->v[1] & & v2 == edge->v[0] failed." 
The current code to detect if bsp2 is needed isn't very good.. I think those crashes just mean that the map needs the -bsp2 flag, but qbsp didn't detect it properly. Improving that is on the todo list. 
Mostly a bug fix update:

- light: add "_sun" entity key to configure sunlight in an entity instead of worldspawn. More than one "_sun" entity is supported.
- light: add "_falloff" light entity key to configure light falloff in map units. Only supported on linear (delay 0) lights.
- light: add "_spotlightautofalloff".
- light: fix light cutoff on curved surfaces
- light: adjust -soft to fix regression in 0.15.10
- qbsp: add "_mirrorinside" key for mirroring the outside faces of bmodels so they are visible from inside. for func_water, or func_illusionary fences, etc.
- qbsp: fix CSG issue with overlapping off grid brushes
- qbsp: fix HOMs introduced in 0.15.10, which were caused by an attempt to fix leaks-through-solids in 0.15.10. To re-enable the buggy code that may fix leaks through solids but add HOMs, use "-contenthack"

Thanks for everyone who reported bugs and m-x-d for the contributions to light :)

Btw - I want to rename the project at some point, any suggestions? something that doesn't have my name in the title, haha. 

or LUMEN for short 
Just call it tyrutils-0.16 to confuse everyone and annoy tyrann (if they're still alive)

I'll have a look to see if the bugs are fixed for me yet, fingers crossed :)
Also, what's the purpose of _sun on an entity? And the purpose of having more than one? 
Yay Thanks 
Lame Name ideas:
Wizann (ericw the wizard + Tyrann)
Map2Bsp (lame i know)

I had been using an older light it seems for the black faces bug. I'll let you know if I run into anymore bugs. 
Yeah - it's time to bump the version to 0.16 soon. I don't want to use "tyrutils" since that makes it sounds like tyrann endorses the tools, I think I have a good name idea though.

I'll have a look to see if the bugs are fixed for me yet

Also, what's the purpose of _sun on an entity? And the purpose of having more than one?
Just convenience, really - figuring out _sun_mangle is a pain; this way lets you target an info_null to set the sunlight vector. It doesn't enable any new features that you can't do with the worldspawn keys, currently.
However, there are some things that would be easier to do with sun settings on entities, one that comes to mind is having a targetname to make them toggle-able (you could totally fade the sunlight with QC if that was implemented.)

Having more than one sun entity is for when your skybox has 2 suns on it. :D 
YAQC - Yet Another Quake Compiler 
Has anyone done this name yet? I've used a lot of "Yet Another X" software over the years.

Other ideas:
QTOOLS - already used for a few projects sadly, but not quake ones.
func_compiler - ???
ericutils - because I know you mentioned not wanting to, but it's TRADITION, DAMMIT!
W(X) - WQBSP, WLIGHT, WVIS etc. Another name reference but a subtle one.

There have been a lot of different tool packages over the years. Most of them have been branded with their author's name, sadly.
It's hard to be creative about something so clinical. 
I can't pretend I'm an engineer or anything, but the urge to come up with cute names for things was irresistable, so I spent a few minutes doing a little research.

Your toolset is aimed at letting people prepare their architectural designs for a Quake, so how about "Strand" or "Tendon"?

I tried working in some reference to Tuned Mass Dampers at first, mainly because I like the phrase, but nothing catchy or meaningful was forthcoming. Maybe somebody else can run with that. 

Believe, BeLieVe or Be_Lie_Ve (Bsp, Light Vis)

Quandary (because you have so many options in LIGHT utils!) 
Quake Is Brown, So 
BrownBrush (bsp)
BrownEye (vis - eye, visibility, geddit?)
BrownStar (light - starlight I guess) 
Brown eye? really??? hahah 
CLEric (compiling & lighting from Eric)


Grammaton Cleric 
Func_compiler Has Several Votes Now 
I'm proud of myself :3c 
Summoning Great Strength 
eQtools. Erics Quake Tools. 
What's wrong with ericw-tools? 
"func_compiler" does have a certain charm.

Or maybe "qompiler" although perhaps that's too vulnerable to typos?

Trying to think of other terms besides "compile"... "quakebake"? 
One I thought of was "arcaneutils".
"ericw-tools" is nice and straightforward though.
"func_compiler" is good, disadvantage is it's hard to say and it would be hard to read without the underscore (e.g. funccompiler). 
God no... 
Just Pick A Simple Grim, Quakey Word And Stick "tools" On The End 

you get the idea 
Definately "Browntools" 
funcTools functools
funcUtils funcutils
fooTools footools
kungfew kungfew 
Arcaneutils is ... ich. The eu in the middle alone is distasteful, let alone the confusion with AD. Plus its so long and just not catchy. Func_compiler is cool, but also long.

func_piler maybe
Arctane maybe
Qtils (q utils)
Lichtools (off the infamous nonexistent Lich Fiend)

Maybe just Func_tools:
The Compiler of Erich Zann

The Tools That Compiled Sarnath 
I like ClEric and Qompiler (maybe shortened to Qompil?). Putting a Q instead of an initial C is a Quake tradition and it would be a nice nod to it.

I agree with Qmaster that Arcaneutils is meh for the exact same reasons. Oh, and whoever came up with The Compiler of Erich Zann is an evil genius! Reminded me of a Mekong Delta album. 
I have a batch file called qompiler :P

its kind of broken right now though. 
I Knew It Sounded Familiar! 
Map jam where every map title is a possible toolset name and the best map wins the right to name the tools

Cue "penispiler" 
The Lesson To Be Learned 
Don't ask Func for name/theme/feature suggestions... 
Better End The Suggestion Period 
ok - scratch arcaneutils. Thanks for the ideas.
probably "ericw-tools" is the pragmatic choice becuase I've heard people refer to it as that anway.. hm. 
You've added so much to TyrUtils that your fork is not really Tyrann's anymore. It deserves your own brand. 
Keep Your Name In It 
It's casual and easy to remember. Plus reminds everyone who's working on it. 
If a func_wall entity has skip-textured faces that goes deep inside the world's brushes, crossing multiple VIS areas, will said entity be "visible" across all those VIS areas, even though it has no faces to render in there?

Maybe this is more of an engine problem. 
I am guessing "yes" they will be visible. skip faces are deleted towards the end of qbsp so they're included in the model mins/maxs - I think.

To optimize for this case I think the engine could build a tighter visible mins/maxs by iterating over all faces/vertices of the model. 
I am guessing "yes" they will be visible. skip faces are deleted towards the end of qbsp so they're included in the model mins/maxs - I think.

To optimize for this case I think the engine could build a tighter visible mins/maxs by iterating over all faces/vertices of the model. 
the qbsp must(imho) calc model bounds according to the maximum of both rendered geometry as well as related collision structures.

Failure to account for collisions means you'll end up missing initial collisions, resulting in entities getting stuck and unable to leave again (more than just a precision error). This is true (although perhaps rarer) even in vanilla. 
played with _falloff, its pretty damn handy. is support for the other delays feasible? 
It should be possible to support for delay 1/2/5 as well. it would be a bit different for these because they extend forever, so maybe "_falloff" would set the distance where they hit 1/255 brightness, or something? 
Shadows On The Snow... 
Using TyrUtils v0.15.11, working on my Frozen map and have encountered some strange shadows. Look at the rock shadow just below the crosshair, this occurs in a few places in the map, the shadow is not very soft and has harsh transition between dark and soft:

Current settings:
sunlight: 200
sunlight_color: 211 163 139
sunlight_mangle: 90 -55 0
sunlight_penumbra: 4
sunlight2: 200
sunlight2_color: 147 115 135
dirt: 1
dirtdepth: 96
dirtgain: 0.75
dirtscale: 0.75
bounce: 1

Its strange because the shadows look good in other places. Any ideas what's going on here? 
Is this the seam you mean?

Are the faces that meet in the rectangle I drew phong shaded? Are they on the same plane?

I guess it's the sample-point-positioning code not working properly. Is the map sealed? Sealing it may help if it's not.

Aside from that all I can suggest is tweak the geometry. Unfortunately there's no easy fix on the tools side and any time I adjust this code it tends to break some maps and make others better.

In general it looks like 0.15.9 was the sweet spot. I would revert to that but it can't handle faces that are partially covered, e.g. func_detail_wall. 
The map is sealed. I changed the geometry of the ground so that there was no seam between brushes near the shadow and the issue cleared up. Only the rock was a detail brush with phong, the ground wasn't.

It is tricky to get rid of all these seams. If I revert to using v0.15.9 can I still use bounce lighting? 
Yeah - bounce was added in 0.15.5.
All the old releases are on the GitHub releases page:

Sorry to hear but I'll try to fix it in the next release :-/ 
Looks like I can use bounce. I may go with v0.15.9 for now. Thanks. 
Ran Into An Issue With Some Lights Being Removed 
Tried re-lighting the stock id1, hipnotic and rogue BSPs with -extra4 -soft. The result is, many badly lit patches sticking out from brush seams and various corners are finally gone, and the shadow edges are just so much better, see an example here.

However, in hipnotic some maps lose some of their lights and become too dark. E.g. the start map loses the lighting from the two lamps in the room where you spawn, even if I run light.exe with no extra options. Any way I can fix this? 
Some More Findings On This Weird Issue 
Okay, so I ran hipnotic's start.bsp through several different versions of light.exe and the results are curious.

I've tried the original TyrUtils, then BJP's enhanced tools, and then finally found the original light.exe from the official hipnotic devkit. The exact same compiler that the original developers used. Still no dice, the map loses some of its lights if re-lit.

Why does this happen? Did they delete some entities from the compiled .bsp file to save on memory usage or what? Really disappointing. 
Apart from hip1m5, hip2m6 and hip3m2, all the other hipnotic maps seem to be build with -range 1. Adding this option restores the original lighting. (The original hipnotic compiler also supports -extra, and they used it.)

Sorry for wasting your time, but maybe this will be helpful to somebody coming from a Google search. 
@ericw Or Other Tools Experts 
Working on my AD Advent map. I have a specific need to have the boundaries of my map func_detail with _phong 1. So i've enclosed the map in a skybox. I know that's inefficient but I need it to be this way. So my question is: should I use skip textures on the outward facing brushes of the func_detail? Will it make any difference in compiling or more importantly, performance? I am using 0.15.9 because of some issues other have already posted about before.

I ask because there are a large number of brushes in this case. 
If the outward faces of the func_detail touch the skybox, there's no need to texture them as skip because qbsp will clip them for you.

The time to use skip is when the faces are not clipped away by qbsp, i.e. you can noclip over to them and see them, but if you know the player can never get to a position where they can see the face, you can mark them as skip so they are deleted from the bsp. It gives a tiny performance boost and reduces the file size / limits a little. 
Will it make any difference in compiling or more importantly, performance?

None whatsoever. 
Thanks. and @OTP in this case I am using FraQuake to make cave walls made up of hundreds of brushes. Sounds like it may be worth the effort in this instance. I'll do a log before and after and share the results. 
Probably irrelvant in your particular example, but keep in mind skip isn't like caulk. It's really just an invisible texture that otherwise behaves just like a normal surface. You won't improve performance by putting skip on out-of-sight faces. More important than the texture used is how QBSP merges the surface.

For instance, if you have a large even wall made up of multiple brushes, all on the same plane, you can optimize the unseen faces (provided they're not removed by QBSP in which case it doesn't matter) by giving them all the same texture and all the same offset (!) - and, depending on size of the wall, upscale the texture by 2/3/4/... This is to make QBSP merge all of them into a single surface and, if the texture scale in big enough in relation to the size of the surface, it'll generate fewer polys.

Example: unlike modern compilers, back in the day QBSP wouldn't automatically optimize sky brushes, so the trick was to upscale sky textures on big outside areas or void maps in order to have each side of the sky box only be made of two polys. Otherwise it would have a lot of unncessary polys affecting the performance. 
Here's what I am up to. Judging by ad_sepulcher I should be okay in this case as you said. But good info on BSP merging. I recall reading how Levelord scaled up black void texture on HIPDM1. Now it makes sense. 
Bear in mind that a lot of tricks to reduce polycount are probably more relevant to 1996 class hardware. 
It may not have a big impact on performance nowadays, but there's still the old protocol/bsp limits. Granted, most people don't care much about these things anymore... I even upscale the texture on large triggers. :E

Another thing that comes to mind regarding that sceenshot is that, at least by the looks of it, the amount of terrain detail may be somewhat excessive for Quake. Like, how much of it is visible to the player - is it well lit or hidden in darkness, or how clearly distinguishable while playing in the first place. Not saying you should make it a flat wall, just maybe a little less 'granular' (bigger brushes)? I think it's what they call the "the ionous dilemma". 
You'll have to wait until Christmas to find out. Or until I get a decent screenshot. But most of this is viable to the player and in some cases lit fairly well. 
If I understand this correctly, I can enable phong shading on a single func_group and leave the rest of the map without phong shading:

Phong shading is enabled on a brush entity using "_phong" "1". It can be used on func_detail or func_group

However, I can't seem to do this in TrenchBroom -- when I edit the entity properties of a func_group containing worldspawn brushes, it changes the properties of all the world brushes in the map... What am I missing? 
TB groups are not the same as func_group, you want to use func_group for this. 
You add it to the func_group itself NOT the brushes within the func_group. 
Thanks, Ericw & Mukor 
TB groups are not the same as func_group

Ah, I did not know this. 
so, how is the progress with the quake 2 lightmaps?

i think this is the most waited stuff for those who wants to dabble with Quake 2 Unit mapping. 
Been using the bsp, vis, & light tools. I've had significant issues crop up while mapping for Hexen 2, in all the maps I've made. Occasionally, seemingly random areas become HOM's in-game. The issue is very odd. I'll make a standard brush, often just a cube, and then the area is HOM in-game. I can delete it, and the problem will go away. But if I make another similar brush in the same place, the problem re-appears. The map is sealed (it should be, since -leaktest has been used). There are no error messages in the compilers (except for "texture skip not found", although I havent used it). It can't be the new textures, because the problem occurred when I wasn't using any. And it probably isn't a port issue because it happens in all the ones I've tested. Here are two example screenshots, with views in-game and in-editor:

The area in the second screenshot seems to have a separate issue from the first - there's no HOM from afar, only when you walk into the specific area. It can't be seen in the still, but the whole screen just stutters with that one frame while in the area. Also different is that no matter how I change & remove brushes in the area, the problem persists. 
Have you tried snapping vertices to grid and vertices to integer on those brushes?

Also I have seen this happen on brushes that intersect.

Not sure if this is helpful. 
Unfortunately that doesn't seem to help. I was able to fix one brush's HOM by deleting a brush next to it. But neither of them intersected, both of them were snapped to the grid, and remaking the deleted brush didn't make the problem reappear. It's so random and frustrating, it feels like it must be a glitch/bug somewhere in the process. 
Another Thing To Try 
Go to an older version of the tools. Might be an issue with the version you are running. 
I overcome the same phenomenon.
Not to blame the new tools, more my poor mapping skills.
I have several maps I restarted after some months and experienced rare anomilies that earlier tools just lacked to cause.

Sometimes an earlier version of the tools come out clear, while older ones causes homs and leaks. 
while the newer ones cause home and leaks. 
Yeah Madfox Is On Point As Always

these tools do a great job at compiling sub-grid/float precision verts.

Maybe give them a try.

Sadly the author vanished. 
If the area is already on grid there's probably not much you can do from the mapper's side (of course even off grid shouldn't break like this); if you can post an issue on github with the .map or a reduced test case that would help fix the problem.

Alternatively trying older versions is a good idea. Maybe check 0.15.9 which was right before I did some major changes to qbsp (func_detail rewrite).

I can't promise a quick fix, I'm taking a break from working on tools right now and I have a backlog of bugs piling up, but I do intend to get back to it and try to fix things at some point. 
I tried some older versions and the problems persisted. Will post an issue, thanks. 
Good Ol Bengt 
Seems like a vis issue ...just throwing this out but maybe try -fast vis?

It is wierd how switching to txqbsp actually hsndles stuff better in a lot of cases of wierd geometry. You should still at least use ericw's vis and much faster. 
Not wanting to start an argument over whats better, but I'll say that I have built some of the most absurd, overly detailed and off grid architecture and ericw's qbsp has never given me a weird error or HOM that wasn't specifically my fault. 
Some Ideas 
Random HOM like this could happen in q3 if the vis wasn't optimal, sealing or cutting sections up with hint faces could fix it. Also try increasing your engines limits; or dividing your map up so it's not rendering so much at once. 
Compile Error For Qbsp 
when I qbsp-compile a(non-trivial, more than 1 room)map with a detail-brush in it, and use the cmd-switch: _forcegoodtree.
I get the error message: "C:\projects\ericw-tools\qbsp\ Q_assert(p->nodes[1]->planenum == -1) failed.
#### Finished with exit status 1
1 post not shown on this page because it was spam
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2020 John Fitzgibbons. All posts are copyright their respective authors.