; Adds glowing exhaust for GT3 cars. Supports ksPerPixel_MultiMap and ksPerPixel shaders.
; Can add either single or two glowing points, mirrored by X axis: works great with
; original Kunos models aligned properly.

; Whole thing is very experimental, please avoid relying on it for now.

[DEFAULTS]
ExhaustGlowTint = 0.5
ExhaustTemperatureMin = 80
ExhaustTemperatureMax = 86
ExhaustDynamicLights = 1
ExhaustAreaScale = 1, 1, 0.15
ExhaustPositioningHelp = 0
ExhaustRadiusInner = 0
ExhaustRadiusThicknessInv = 12.5
ExhaustMirror = 1
ExhaustNormalsK = 0.8
ExhaustLightRange = 0.4

; Other optional params
ExhaustMeshes_MultiMap =
ExhaustMeshes_PerPixel =
ExhaustMeshes_Reflection =
ExhaustMeshes_NM =
ExhaustMeshes_MMNMD =
ExhaustExplicitBound =
ExhaustLightPoint =

[SHADER_REPLACEMENT_0_EXHAUST_GLOW_MM]
ACTIVE = ${ExhaustMeshes_MultiMap:count}
MESHES = ${ExhaustMeshes_MultiMap}
SHADER = nePerPixelMultiMap_heating

[SHADER_REPLACEMENT_0_EXHAUST_GLOW_PP]
ACTIVE = ${ExhaustMeshes_PerPixel:count}
MESHES = ${ExhaustMeshes_PerPixel}
SHADER = nePerPixel_heating

[SHADER_REPLACEMENT_0_EXHAUST_GLOW_PR]
ACTIVE = ${ExhaustMeshes_Reflection:count}
MESHES = ${ExhaustMeshes_Reflection}
SHADER = nePerPixelReflection_heating

[SHADER_REPLACEMENT_0_EXHAUST_GLOW_NM]
ACTIVE = ${ExhaustMeshes_NM:count}
MESHES = ${ExhaustMeshes_NM}
SHADER = nePerPixelNM_heating

[SHADER_REPLACEMENT_0_EXHAUST_GLOW_MMNMD]
ACTIVE = ${ExhaustMeshes_MMNMD:count}
MESHES = ${ExhaustMeshes_MMNMD}
SHADER = nePerPixelMultiMap_NMDetail_heating

[SHADER_REPLACEMENT_1_EXHAUST_GLOW]
MESHES = ${ExhaustMeshes_MultiMap}, ${ExhaustMeshes_PerPixel}, ${ExhaustMeshes_Reflection}, ${ExhaustMeshes_NM}, ${ExhaustMeshes_MMNMD}
PROP_10 = ev0_pos, $ExhaustPoint
PROP_11 = ev0_inner, $ExhaustRadiusInner
PROP_12 = ev0_thicknessInv, $ExhaustRadiusThicknessInv
PROP_13 = ev0_tint, $ExhaustGlowTint
PROP_14 = ev0_symmetryX, $ExhaustMirror
PROP_15 = ev0_scale, $ExhaustAreaScale
PROP_16 = ev0_normalsK, $ExhaustNormalsK
PROP_17 = ev0_pad, 0.2
PROP_20 = ksEmissive, 0

[EMISSIVE_WATER_TEMP_0_EXHAUST_GLOW]
MESHES = ${ExhaustMeshes_MultiMap}, ${ExhaustMeshes_PerPixel}, ${ExhaustMeshes_Reflection}, ${ExhaustMeshes_NM}, ${ExhaustMeshes_MMNMD}
COLOR = 15, 3, 0
USE_SMOOTH_TRANSITION = 1
INPUT_MIN = $ExhaustTemperatureMin
INPUT_MAX = $ExhaustTemperatureMax
INPUT_LUT = (| $ExhaustTemperatureMin = 0 | $ExhaustTemperatureMax = 1 |)

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustExplicitBound:count}
BOUND_TO = ${ExhaustExplicitBound:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustMeshes_MultiMap:count}
BOUND_TO = ${ExhaustMeshes_MultiMap:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustMeshes_PerPixel:count}
BOUND_TO = ${ExhaustMeshes_PerPixel:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustMeshes_Reflection:count}
BOUND_TO = ${ExhaustMeshes_Reflection:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustMeshes_NM:count}
BOUND_TO = ${ExhaustMeshes_NM:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = ${ExhaustMeshes_MMNMD:count}
BOUND_TO = ${ExhaustMeshes_MMNMD:1}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
BOUND_EMISSIVE_MAX = 15
SELF_LIGHTNING = 1
EXTERIOR_ONLY = 1
INTERIOR_ONLY = 0
SPECULAR_MULT = 0
AFFECTS_TRACK = 0
SINGLE_FREQUENCY = 1
DIFFUSE_CONCENTRATION = 0.6
RANGE = $ExhaustLightRange
RANGE_GRADIENT_OFFSET = 0
DISABLE_WITH_EMISSIVE_LIGHT = 1
COLOR = $" ${ExhaustDynamicLights:bool} and 10 or 0 "

[LIGHT_EXTRA_0_EXHAUST_GLOW]
POSITION = $ExhaustLightPoint

[LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = $ExhaustMirror
POSITION = -${ExhaustLightPoint:1}, ${ExhaustLightPoint:2:2}

[LIGHT_EXTRA_0_EXHAUST_GLOW, LIGHT_EXTRA_1_EXHAUST_GLOW]
ACTIVE = $ExhaustPositioningHelp
DIFFUSE_CONCENTRATION = 1
BOUND_TO = 
RANGE = 1
COLOR = 100
AFFECTS_TRACK = 1
SPECULAR_MULT = 1

[EXTRA_FX_EMISSIVE_...]
MESHES = ${ExhaustMeshes_MultiMap}, ${ExhaustMeshes_PerPixel}, ${ExhaustMeshes_Reflection}, ${ExhaustMeshes_NM}, ${ExhaustMeshes_MMNMD}
RANGE = 0.2
COLOR = 0.2
DIRECTED = 0
