#626 posted by PRITCHARD on 2016/11/21 13:31:35
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 :/)
Qbsp
#627 posted by Qmaster on 2016/11/21 16:20:54
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.
#628 posted by ericw on 2016/11/21 18:34:11
@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
#629 posted by PRITCHARD on 2016/11/22 03:11:09
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?
#630 posted by ericw on 2016/11/22 03:37:27
-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.
#631 posted by khreathor on 2016/11/22 12:15:47
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?
#632 posted by Kinn on 2016/11/22 12:49:05
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
#634 posted by Kinn on 2017/01/04 23:00:03
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?
#635 posted by metlslime on 2017/01/05 02:43:22
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
#636 posted by Kinn on 2017/01/05 03:20:16
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.
#637 posted by mankrip on 2017/01/05 03:22:38
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.
#637
#638 posted by Kinn on 2017/01/05 03:32:49
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!
#639 posted by ericw on 2017/01/05 03:49:22
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.
#640 posted by Kinn on 2017/01/05 04:04:16
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.
Also
#641 posted by Kinn on 2017/01/05 04:12:24
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?
#642 posted by ericw on 2017/01/05 04:27:40
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.
#643 posted by Kinn on 2017/01/05 04:44:38
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.
Kinn
#644 posted by mankrip on 2017/01/05 17:52:08
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
#645 posted by PuLSaR on 2017/01/07 18:24:52
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?
#646 posted by ericw on 2017/01/07 20:26:21
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.
So
#647 posted by PuLSaR on 2017/01/07 20:56:40
If the bmodel doesn't touch another solid, the problem should be gone?
#648 posted by ericw on 2017/01/07 22:23:15
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)
Thanks
#649 posted by PuLSaR on 2017/01/07 22:28:39
that was very helpful
Ericw
does "-bounce 1" bounce lights with negative values?
|