; Some general helper things
[TEMPLATE: HumanSurface]
@OUTPUT = SHADER_REPLACEMENT_...
SHADER = smHumanSurface
PROP_0_... = extHairInclusionInvArea0, 0, 0, 1, 1
PROP_0_... = extHairInclusionInvArea1, 0, 0, 1, 1
PROP_0_... = extHairExclusionArea0, -1, -1, -1, -1
PROP_0_... = extHairExclusionArea1, -1, -1, -1, -1
PROP_0_... = extHairExclusionArea2, -1, -1, -1, -1
PROP_0_... = extHairExclusionArea3, -1, -1, -1, -1
PROP_0_... = extFakeShadowParams0, 0, 0, 0, 0
PROP_0_... = extFakeShadowParams1, 0, 0, 0, 0

[TEMPLATE: HumanSurface_Tweak]
@OUTPUT = SHADER_REPLACEMENT_...

[MIXIN: HumanSurface_HairInclusionInvArea]
_HsHairInclusionInvArea = $" def($_HsHairInclusionInvArea, -1) + 1 "
PROP_... = extHairInclusionInvArea${_HsHairInclusionInvArea}, $"{ ${Start:vec2} / ${Resolution:vec2}, ${Size:vec2} / ${Resolution:vec2} }"

[MIXIN: HumanSurface_HairExclusionArea]
_HsHairExclusionArea = $" def($_HsHairExclusionArea, -1) + 1 "
PROP_... = extHairExclusionArea${_HsHairExclusionArea}, $"{ ${Start:vec2} / ${Resolution:vec2}, ${Size:vec2} / ${Resolution:vec2} }"

[MIXIN: HumanSurface_Eye]
PROP_STRUCT_... = extEye${Side}Params, 80, $" 
  local _left = $Side == 'L'
  local _resolution = ${Resolution:vec2}
  local _tweakOut = ${TweakOut:vec4} -- offsetPow1, offsetPow2, sizePow1, sizePow2
  local _tweakIn = ${TweakIn:vec4} -- offsetPow1, offsetPow2, sizePow1, sizePow2
  local _tweakTwist = ${TweakTwist:vec4} -- amount, from, falloffStart, falloffEnd
  if _tweakTwist == vec4() then 
    _tweakTwist = vec4(0, 1, 1, 2)
  elseif not _left then 
    _tweakTwist = vec4(_tweakTwist.x, -_tweakTwist.y, -_tweakTwist.z, -_tweakTwist.w)
  end
  return {
    ${Iris:vec2} / _resolution, def($FullMovementMult, 100), _resolution.y / _resolution.x,
    ${Start:vec2} / _resolution, ${Size:vec2} / ${Resolution:vec2},
    _left and _tweakIn or _tweakOut, _left and _tweakOut or _tweakIn, _tweakTwist
  }"

[MIXIN: HumanSurface_FakeShadow]
_HsFakeShadow = $" def($_HsFakeShadow, -1) + 1 "
PROP_... = extFakeShadowParams${_HsFakeShadow}, $"{ ${Position:vec3}, pow(${Radius:number}, 2) }"
