Results 1 to 6 of 6

Thread: mapLightScale got broken since the introduction of new ent_dota_lightinfo parameters

  1. #1
    Basic Member MaxOfS2D's Avatar
    Join Date
    Jun 2015
    Location
    France
    Posts
    139

    Question mapLightScale got broken since the introduction of new ent_dota_lightinfo parameters

    It seems like mapLightScale in a camera's animation set editor isn't fully zeroing the appropriate global light properties anymore.



    This makes the shadows on characters (and everything that's using the "Hero" shader) appear inverted when mapLightScale is low enough. This is a GIF made in dota.vmap, there is just no background because I pulled in farz very close for crisper shadows. I also thought this might have been a material diffuse warp thing at first, but it's not, I checked.


    My interpretation of the issue: it looks like it's forgetting to zero out what is marked as "Shadow Scale" in Hammer's ent_dota_lightinfo (not "Shadow Ground Scale", which works properly and affects GlobalLitSimple materials, whereas "Shadow Scale" is for the "Hero" shader—am I getting that right?). Everything else interpolates to zero but this parameter, hence the shadows stay "bright" and look inverted when mapLightScale is set to 0.

    Here's a Hammer Map Editor screenshot where I've set all of the Light/Ambient/Shadow values to 0, except the "Shadow Scale" one, and it reproduces the same look of the issue in SFM, so it has got to be the parameter that's not getting touched by the slider properly anymore.



    I tried this out in a bunch of maps—my own, Valve's, and some that I haven't touched for two years at this point—but the behaviour is the same every time.

    (I'm going on a wild guess here, but I think this might be tied to the new properties in ent_dota_lightinfo. I think you folks have added "Shadow Secondary Color", which allows tinting the "Hero" shadows separately from the "GlobalLitSimple" ones. And there's also "Ambient Shadow Amount", which seems to be controlling how much of the ambient light is allowed in the sunlight's shadow.)

    As a side note, I know this issue has been in SFM2 as far back as at least as May 30th, because I went back into my TI7 project back then to do a little joke post and I'd noticed that the lighting was a bit brighter then... I just checked now, and sure enough, those scenes have the mapLightScale slider set to about half... so that joke post was affected by the bug too! Funny how I'm getting answers to a passing "huh" moment, over a month after.

    It's not a huge issue to fix compared to, like, the spawning models thing, but, since it's Short Film Contest season, a fix would be nice to have soon

  2. #2
    Basic Member Toyoka's Avatar
    Join Date
    Oct 2013
    Location
    Current position co-ordinates non-tracable. Unknown space.
    Posts
    833
    Have you tried setting the "Shadow Secondary color" set of colors to black? I noticed that something changed since that second set was added. Maybe changing those to black could fix the issue? Worth a try, at least (if you haven't already done so).

  3. #3
    Basic Member MaxOfS2D's Avatar
    Join Date
    Jun 2015
    Location
    France
    Posts
    139
    Oh man, you're actually right! It turns out that "Shadow Secondary Color" might be the culprit... I'm a little confused now.

    So the big questions are

    FIRST, did the addition of "Shadow Secondary Color" change our lighting without us knowing? What exactly does the "Shadow Secondary Color" parameter do? Is it additive, negative, a sort of "overlay" blend? Is it set up to be effectively doing nothing if its value doesn't diverge from "Shadow Color"?

    With ambient scale set to 0, here's the shadow color set to pure red and the shadow secondary color set to pure black, then vice versa, the scale numbers not being touched.





    Am I correct in thinking there is some kind of directionality here? Primary seems like it has the old behaviour, no problem there, but the secondary comes from straight bottom, and is not taking normal maps into account? This is so puzzling. I would love to have some insight on what exactly this parameter is supposed to do, why it was added, etc.

    SECOND, going back to the SFM bug...

    I think I was slightly mistaken on what mapLightScale is doing then: it's not touching the "scale" numbers at all... just lerping the color values towards 0,0,0 ? And since that one's new... in an oversight, it wasn't hooked up to the parameter?

    Right now, in Hammer, I can reproduce the SFM issue by setting all colors to black except "Shadow Secondary Color" so that's gotta be it, yeah

  4. #4
    Basic Member Toyoka's Avatar
    Join Date
    Oct 2013
    Location
    Current position co-ordinates non-tracable. Unknown space.
    Posts
    833
    Yea, Secondary has a different angle parameter or something (I don't recall exactly what it's based on). I did some testing when it was first introduced and it seems like it has a modular or additive effect to the base shadow color. You can "stack" shadow colors to create some interesting effects and you can also change angles of both independently to have 2 separate shadows with their own colors (think? I don't exactly remember how I did it as it was not very obvious by the lack of separate angle parameters for each shadow color in the lightinfo). But yea, Secondary Shadow Color has proved to be an interesting, if not puzzling addition to the lightinfo entity. I just wish we had more information or some documentation with these sorts of updates :P

  5. #5
    Basic Member MaxOfS2D's Avatar
    Join Date
    Jun 2015
    Location
    France
    Posts
    139
    Yep, I am definitely hoping joe_prime can some... shed some light... on this

  6. #6
    Valve Developer
    Join Date
    Jun 2015
    Posts
    24
    Yep, Shadow Secondary Color wasn't being properly dimmed - this is now fixed locally and will go out with an update sometime soon. Shadow Color and Shadow Secondary Color are blended between based on to what degree the pixel is facing up vs down.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •