Netradiant / Qbsp Leak Finding
#540 posted by ww on 2016/09/26 21:21:10
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?
#541 posted by ericw on 2016/09/26 21:53:14
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
Func_detail
#542 posted by Qmaster on 2016/09/28 00:30:06
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: https://developer.valvesoftware.com/wiki/Func_detail
func_detail will always cut up brushes. It's sole purpose is to speed up vis.
Purely Out Of Interest
#544 posted by Kinn on 2016/09/28 00:51:27
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.
#547 posted by ericw on 2016/09/28 01:19:20
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
#548 posted by ericw on 2016/09/28 01:36:32
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
#549 posted by Qmaster on 2016/09/28 01:57:05
Ok. On a related note, can func_wall have keys added to receive and block lighting identically to a func_detail.
Yep
#550 posted by ericw on 2016/09/28 02:14:48
"_shadow" "1"
You're The Best, Thanks!
#551 posted by Qmaster on 2016/09/28 02:27:28
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: https://ubiquitousgame.files.wordpress.com/2016/09/01.jpg). Is there anything I could try to get better looking lightmap resolution?
#552
#553 posted by Kinn on 2016/09/28 14:29:49
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 ^_^"
#554 posted by dwere on 2016/09/28 14:34:06
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
#555 posted by mankrip on 2016/09/28 14:37:35
This is a limitation of the vanilla BSP format. Lit2 solves it, but only a few engines supports it.
#554
#556 posted by Kinn on 2016/09/28 17:35:58
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.
#552
#557 posted by khreathor on 2016/09/28 19:14:12
what about "-soft 2" or even more?
#558 posted by Spike on 2016/09/28 19:41:06
higher-res lightmaps have their perks: http://triptohell.info/moodles/junk/fte-20150311190731-0.jpg
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
#559 posted by ericw on 2016/09/28 19:54:10
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
#561 posted by metlslime on 2016/09/28 20:21:17
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?
#562 posted by Spike on 2016/09/28 20:36:46
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?
#564 posted by mh on 2016/09/28 21:16:53
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.
|