#790 posted by ericw on 2017/04/03 00:24:18
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.
Beta
#791 posted by mjb on 2017/04/03 13:52:27
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!
#792 posted by anonymous user on 2017/04/12 22:34:25
latest build from here has a bug.
Rotate_object arent lit, leaves them all black.
Thx
#793 posted by ericw on 2017/04/12 22:51:51
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
#794 posted by mankrip on 2017/05/08 03:24:19
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.
Hmm...
#795 posted by Qmaster on 2017/05/08 05:10:11
r_waterfalloff
r_slimefalloff
r_lavafalloff
#796 posted by Rick on 2017/05/08 05:53:40
But lava glows on its own. So does slime, doesn't it?
#797 posted by PRITCHARD on 2017/05/08 07:07:13
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?
#798 posted by brassbite on 2017/05/08 07:29:15
Never knew they exist...
#799 posted by PRITCHARD on 2017/05/08 07:43:43
I've never tried using them myself but it's in the docs.
#800 posted by Rick on 2017/05/08 14:21:20
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.
#801 posted by mh on 2017/05/08 18:14:03
Attenuate faster if the trace crosses a water surface.
How do you see this working with moving liquid bmodels?
MH
#802 posted by mankrip on 2017/05/08 18:53:56
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.
#802
#803 posted by mankrip on 2017/05/08 18:56:38
#804 posted by ericw on 2017/05/08 20:23:05
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..."
#805 posted by Qmaster on 2017/05/08 20:44:01
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).
#806 posted by ericw on 2017/05/08 21:17:09
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.
#804
#807 posted by mankrip on 2017/05/09 08:29:36
Thanks!
No problem, I can wait.
Light Diff
#808 posted by mankrip on 2017/05/10 02:22:17
Idea:
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.
#809 posted by PRITCHARD on 2017/05/10 02:26:18
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...
#810 posted by mankrip on 2017/05/10 02:53:46
testing within each light's radius
Only for the light entities that changed. Quite often, it will be only 1 light.
#811 posted by ericw on 2017/05/10 03:13:41
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.
#812 posted by metlslime on 2017/05/10 06:24:56
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.
#813 posted by PRITCHARD on 2017/05/10 07:16:07
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...
#814 posted by mh on 2017/05/10 21:49:16
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.
|