DotA:Hero Shader
-Added "CustomHero" shader for DotA.
-Designed to provide a variety of visual looks but still allow for globally-applicable status effects
-Includes 2 detail textures, one which is maskable for hero-specific attributes, one which applies to the whole mesh for status effects
-Includes 3D texture lookup into RGB colorspace for single-character tonemapping to display status effects
-All masks can be blended away, so that some status effects can use things like specularity, metalness, or envmapping to communicate state
-Diffuse warp and fresnel color warp work in tandem to create cloth or flesh looks
-Spec and env can be modulated by the albedo texture
-Metalness allows reflection color to be drawn from albedo diffuse to be darkened
-Scalars for rim lighting and ambient lighting that can be used to communicate unit selection
-Fresnel terms are drawn from a texture rather than parameterized
-rgbcolorspace can be used as basis for new colorwarps
-fresnelranges is default texture from which fresnel terms are drawn
------------------------------------------------------------------------------
CustomHero Parameters:
$BASETEXTURE: texture; albedo map
$NORMALMAP: texture; normal map; not active under ps20
$BASETEXTURETRANSFORM: allows proxies to base and normal map UVs
$DETAIL1: texture; detail map 1 which can be masked
$DETAIL2: texture; detail map 2 for all-over status effects (no mask)
$MASKMAP1: texture; effect masks:
R=detail1 mask, white=use detail
G=diffusewarp and fresnel color warp, white=use warps, black=use half-lambert, fresnelcolorwarp is ps20b+
B:metalness, white=black-out albedo and ignore fresnel for reflections, can also mask env
A:self-illum, white=self-illum where color is drawn from combined albedo, colorwarp and detail maps
$MASKMAP2: texture; effect masks:
R=specular, white=full spec, black=no spec, masks env by default
G=rim, white=reflective, black=not
B=tint reflections by base map, INVERTED! black=tint by base, white=use $specularcolor
A=scale factor of $specularexponent, or, if $specularwarp is enabled, controls the V coordinate of the lookup into the gradient map
$DIFFUSEWARP: texture, remap diffuse lighting to gradient, mutually exclusive with specularwarp
$SPECULARWARP: texture, remap specular lighting for iridescent effects, when enabled uses the A channel of maskmap2 for the V coordinate of the lookup, U is a direct mapping of the specular falloff when the exponent is 1, mutually exclusive with diffusewarp
$COLORWARP: 3D texture, color warp albedo using RGB color-space lookup table, can be used for all sorts of tonemapping effects including hue shifting, channel mixing, contrast adjustments, desaturation, etc.
$FRESNELCOLORWARP: 3D texture, fresnel-based color warp using RGB color-space lookup table, useful for skin/cloth, avialable for ps20b+ (so consider it a visual enhancement, not a gameplay signal)
$ENVMAP: cubemap, cube-map based reflection; not active under ps20
$FRESNELWARP: texture default "engine/fresnelranges", gradient ramps for intensity of fresnel terms: R=rim, G=fresnel color warp, B=specular; rim ramp has no effect under ps20, instead we do a hard-coded curve
$DETAIL1SCALE: float, scale detail1 as multiplier of base UVs
$DETAIL1FRAME: frame number for detail1
$DETAIL1BLENDMODE: integer, detail 1 blend mode: 0=off, 1=add, 2=add self-illum, 3=mod2x
$DETAIL1BLENDFACTOR: float, detail 1 blend factor
$DETAIL1BLENDTOFULL: float, "range 0-1, blend effect from masked to all-over" )
$DETAIL1TEXTURETRANSFORM: allows proxies to manipulate detail1 UVs
$DETAIL2SCALE: float, scale detail2 as multiplier of base UVs
$DETAIL2FRAME: float, frame number for detail2
$DETAIL2BLENDMODE, integer, detail 2 blend mode: 0=off, 1=add, 2=add self-illum, 3=mod2x, 4=mul, 5=crossfade
$DETAIL2BLENDFACTOR: float, detail 2 blend factor
$DETAIL1TEXTURETRANSFORM: allows proxies to manipulate detail2 UVs
$DIFFUSEWARPBLENDTOFULL, SHADER_PARAM_TYPE_FLOAT, "0.0", "range 0-1, blend effect from masked to all-over" )
$COLORWARPINTENSITY, SHADER_PARAM_TYPE_FLOAT, "0.0", "range 0-1, intensity of albedo color warping" )
$FRESNELCOLORWARPBLENDTOFULL: float; range 0-1, blend effect from masked to all-over
$SPECULAREXPONENT: float; higher = glossier; affected by A channel of $MASK2, where the channel's value represents a range from 1.0 to the specified exponent
$SPECULAREXPONENTBLENDTOFULL: float; range 0-1, blend effect from masked to all-over
$SPECULARBLENDTOFULL: float; range 0-1, blend effect from masked to all-over
$SPECULARCOLOR: vec; color to use for tinting the specular highlights wherever the tint-by-base effect is not active
$SPECULARSCALE: float; scale specular intensity
$MASKENVBYMETALNESS, bool, use metalness to mask envmap rather than using spec mask
$ENVMAPINTENSITY, float; affect overall intensity of envmap
$REFLECTIONSTINTBYBASEBLENDTONONE, float; range 0-1, blend effect from masked to off
$METALNESSBLENDTOFULL: float; range 0-1, blend effect from masked to all-over, metalness steals color from albedo while preserving the ability to tint reflections by the base map
$AMBIENTSCALE: float; scale ambient light by this amount
$RIMLIGHTSCALE: float; scale rimlight by this amount
$RIMLIGHTBLENDTOFULL: float; blend effect from masked to all-over
$RIMLIGHTCOLOR: vec; color to use for tinting the rimlight
$SELFILLUMBLENDTOFULL: float; range 0-1, blend effect from masked to all-over
$CLOAKPASSENABLED: bool; enable cloaking
$CLOAKFACTOR: float; range 0-1, blend effect from none to full
$CLOAKCOLORTINT: vec, color tint, default [1 1 1]
$REFRACTAMOUNT: float; range whatever, default 2, amount to refract through cloak effect
$CLOAKINTENSITY: float, range 0-1, default 1, opacity of cloak effect over base, 1=full, 0=transparent
-Fog is using hack for underwater where it fogs full. If we ever see more than toes underwater, we should fix this
-Cloak is enabled but seems to be fighting with the flashlight. WIP.
--------------
For animated texture proxies, use the following:
$FRAME (for base texture)
$NORMALMAPFRAME
$DETAIL1FRAME
$DETAIL2FRAME