1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tinting.

Discussion in 'Help' started by ResonanceChaos, Aug 31, 2016.

  1. ResonanceChaos

    ResonanceChaos Potential Patron

    Joined:
    Jul 19, 2016
    Messages:
    2
    Likes Received:
    0
    Easy question, right?
    "How does skin tinting work?"
    You would think with hundreds of guides on making hair, clothing, animations, dialogues, everything you can think of, that somewhere out there someone has put down in words how the HSL C tinting sliders function.

    I've searched for days and found nothing.

    From what I can infer, they're for Hue, Saturation, and Lumosity (plus the C which I haven't figured out yet). Except the Hue slider value of 0 doesn't correspond with hue 0, leaving me baffled.

    Any insight would be greatly appreciated.
     
  2. stuntcock

    stuntcock Club Regular Staff Member Moderator

    Joined:
    Jun 5, 2012
    Messages:
    1,523
    Likes Received:
    355
    The HSL value describes a transformation in a cylindrical coordinate system. SDT applies the HSLC value via a built-in Flash transformation class (ColorMatrixFilter), but it uses an internal hardcoded function (g.getCMFMatrix) to express a 4-digit HSLC transform as a 4x5 matrix. It's complicated. The code isn't documented. There are many hardcoded magic numbers.

    But what you meant was "how can I make skin tinting work for me?" As in: "I want the girl's skin to be bright red. How do I pull numbers out of my ass to make that happen?"

    Open up an RGB slider (any of them) and use the eyedropper tool to grab a spot of skin. We usually don't know exactly what the girl is supposed to look like after the transformation, but I'll cheat by using @sclover13's mod. This gives us a set of before-and-after RGB values. If you're not cheating, then you'd need to estimate the target RGB value (which means that your transformation will need a bit more fine-tuning at the end).

    [​IMG]
    Let's put those values on the HSL scale.
    Before (dark skin): 27,40,43
    After (red skin): 20, 92, 42
    Note: if you're clever then you can skip the "target RGB" step and instead choose your target skin color via an online HSL slider tool.

    How can we mathematically convert the before value into after?
    Hue 27 → 20 ... Add -7
    Saturation 40 → 92 ... Multiply by 2.3
    Luminance 43 → 42 ... Multiply by 0.98

    The main thing here is that we need to boost the Saturation significantly. You can plug those numbers into the skin HSL sliders (or just use this charcode skinhsl:-7,2.3,0.98,1; ). You'll see that the result doesn't perfectly match what we wanted; her skin is slightly too green. In fact, @sclover13's charcode is skinhsl:8,2.63,0.91,1; . Why is it different? The answer probably lies somewhere in @Konashion's hardcoded magic numbers. But we don't need a precise explanation. The result is close enough; you can now tinker with the sliders until you obtain a satisfactory result.

    Chromaticity. Rarely used in SDT mods, because it tends to make characters look very peculiar (e.g. "this girl is entirely composed of grey shadow" or "her skin is a big bright featureless orange blur" or just "that looks stupid and wrong").

    Edit: Chromaticity is incorrect. See Faceless' post below.
     
    ResonanceChaos and tmb like this.
  3. Faceless

    Faceless Club Regular Content Creator

    Joined:
    Jun 12, 2011
    Messages:
    1,118
    Likes Received:
    22
    Pretty sure it's contrast, not chromaticity. Chromaticity, according to wiki, is roughly equivalent to the H and S of HSL color space, and playing with those two sliders won't let you duplicate the effects of the C slider at all.
     
  4. ResonanceChaos

    ResonanceChaos Potential Patron

    Joined:
    Jul 19, 2016
    Messages:
    2
    Likes Received:
    0
    You're a gentleman and a scholar, sir. You have my deepest gratitude. :D