;;CONTAINS ALL NECESSARY LINES FOR THE LIGHTS TO WORK AND PBR CONFIG
[INCLUDE: common/materials_glass.ini]
[INCLUDE: common/materials_interior.ini]

[INCLUDE: android_auto/config.ini]
[Display_AndroidAuto]
Meshes = GEO_Cockpit_HR_SUB18 ; display mesh
Resolution = 1280, 720 ; texture resolution
Size = 1270, 710        ; size of the screen area
Offset = 0, 0             ; left top corner of screen area
Scale = 1 ; might need adjusting to get the scale right
RearCameraPosition = -0.00, 0.92, -2.4  ; position of rear view camera
aftermarketComponent=1

[REAL_MIRROR_0]
FOV=10
ROTATION=0.01, 0.02

[REAL_MIRROR_1]
FOV=8
IS_MONITOR=0
ROTATION=0.05, -0.01

[REAL_MIRROR_2]
FOV=12
ROTATION=-0.01, 0.02

[SHADER_REPLACEMENT_...]
MESHES = GEO_Cockpit_HR_SUB18
SHADER = ksPerPixel
PROP_... = ksEmissive, 1, 1, 1

[EXTRA_FX]
GLASS_FILTER = __navigator_mesh_1
SKIP_GBUFFER = material:INT_Glass_Display

 local flames = ac.Particles.Flame({
   color = rgbm(0.5, 0.5, 0.5, 0.5),
   size = 0.2,
   temperatureMultiplier = 1,
   flameIntensity = 2
 })

 function script.update(dt)
   if car.brake > 0.5 then
     flames:emit(vec3(0, 1.5, 0), vec3(0, 1, 0), 1)
   end
 end


[INCLUDE]
INCLUDE=common/no_popup_lights.ini

[DATA] 
DISABLE_LIGHTSINI = 1

[Material_PhotoelasticGlass]
Meshes = EXT_Glass_Front_Outer
Materials = EXT_Glass_Emissive_Front
FilmIOR = 2.2
ThicknessMult = 0.5
Desaturate = 0
MaskPass = 2

;;LIGHT EMISSIVES
[EMISSIVE_LIGHT_...]
NAME=LOW_BEAM
COLOR=45,45,50, 3.0
LAG=0.0
SIMULATE_HEATING=0
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=EXT_Emissive_Main_Lights
BOUND_TO=LOW_BEAM
COLOR=45,45,50, 1
LAG=0.0
SIMULATE_HEATING=0
LOCATION=FRONT
CAST_LIGHT=0
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=DRL
OFF_COLOR=120,120,120, 0.5
LAG=0.1
SIMULATE_HEATING=0.2
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_HIGHBEAM_...]
NAME=HIGH_BEAM
BOUND_TO= LOW_BEAM
COLOR=45,45,50, 3.0
LAG=0.0
SIMULATE_HEATING=0
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=EXT_Emissive_Taillights
COLOR=20,8,1
OFF_COLOR=0,0,0

[EMISSIVE_LIGHT_...]
NAME=GEO_DISPLAY_Emissive
COLOR=3,3,3,5
OFF_COLOR=2,2.2,2.4,4
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=polymsh_extracted13
COLOR=3,3,3,5
OFF_COLOR=2,2.2,2.7,2
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=Cylinder5, Cylinder3, Cylinder6, Cylinder4
COLOR=3,3,3,5
OFF_COLOR=2,2,2.7,4
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=GEO_Paddle_DW_SUB2
COLOR=3,3,3,1
OFF_COLOR=1,1.2,1.7,1
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=GEO_Paddle_UP_SUB2
COLOR=3,3,3,1
OFF_COLOR=1,1.2,1.7,1
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=lod0_int_steer_ObjOff_SUB3
COLOR=3,3,3,100
OFF_COLOR=1,1.2,1.7,1
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_LIGHT_...]
NAME=GEO_Cockpit_HR_decals_SUB0
COLOR=3,3,3,3
OFF_COLOR=1,1.2,1.7,1
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5

[EMISSIVE_BRAKE_...]
NAME=EXT_Emissive_Brakes
COLOR=255,0,0,1.5
FALLBACK_HEADLIGHTS_COLOR=
LAG=0.0
SIMULATE_HEATING=0
LOCATION=REAR
CAST_LIGHT=1

[EMISSIVE_TURNSIGNAL_LEFT_...]
NAME=EXT_Emissive_Turnsignal_RL
COLOR=5, 15, 0,10
SMOOTH_IN=1
LAG=0.0
SIMULATE_HEATING=0.5
LOCATION=REAR
[LIGHT_TURNSIGNAL_LEFT_0]
COLOR=1, 0.5, 0, 3

[EMISSIVE_TURNSIGNAL_RIGHT_...]
NAME=EXT_Emissive_Turnsignal_RR
COLOR=5, 15, 0,10
SMOOTH_IN=1
LAG=0.0
SIMULATE_HEATING=0.5
LOCATION=REAR
[LIGHT_TURNSIGNAL_RIGHT_0]
COLOR=1, 0.5, 0, 3

[EMISSIVE_TURNSIGNAL_LEFT_...]
NAME=EXT_Emissive_Turnsignal_FL
COLOR=150, 50, 0,10
SMOOTH_IN=1
LAG=0.0
SIMULATE_HEATING=0.5
LOCATION=REAR

[EMISSIVE_TURNSIGNAL_RIGHT_...]
NAME=EXT_Emissive_Turnsignal_FR
COLOR=150, 50, 0,10
SMOOTH_IN=1
LAG=0.0
SIMULATE_HEATING=0.5
LOCATION=REAR

[EMISSIVE_REVERSE_...]
NAME= EXT_REVERSE
COLOR=25.5, 25.5, 25.5, 5
CHANNEL=0
LAG=0.5
SIMULATE_HEATING=2

[LIGHT_LICENSEPLATE]
MESHES=Plate_LODA
OFFSET=0.0, 0.07, -0.0
RANGE=0.65
RANGE_GRADIENT_OFFSET=0.15
SPOT=120
SPOT_SHARPNESS=0
COLOR=4.4, 4.4, 4.4, 3
MIRROR=0, 0, 0
FALLBACK_EMISSIVE=2, 2 , 1.8, 6
LAYOUT=TWO_ON_TOP
FADE_AT=180
FADE_SMOOTH=1
ACTIVE=1
AFFECTS_TRACK=1

[EMISSIVE_LIGHT_...]
NAME= EXT_Emissive_Light_Front001
COLOR=45,45,50, 2.0
ACT_AS_HEADLIGHTS=1
CAST_LIGHT = 1
LOCATION = FRONT
BIND_TO_HEADLIGHTS=1

;;LIGHT PBR
[Material_Aluminium_v2]
Materials = EXT_Emissive_Light_Rear
Smoothness = 0.95
Metalness = 0.8
Reflectance = 1
BrightnessAdjustment = 1
CubemapReflectionBlur = 0
PROP_22=pbReflectionBlurEnv, 0
HasDetailNormals=1

;;RIM PBR
[Material_InteriorPBRDetail]
Materials=EXT_Rim
Reflectance=0.1
CubemapReflectionBlur=0.82
DetailScale=40
ApplyTilingFix=1
BrightnessAdjustment = 0.1

[Material_InteriorPBRDetail]
Materials = EXT_Decals
Reflectance=0.0
Smoothness=0.15
Metalness=0.15
CubemapReflectionBlur=0.95
Brightness=0.7
OcclusionMult=1
DetailScale=30
ApplyTilingFix=1
OcclusionSource = NONE

[Material_Carbon]
Materials= carbonexterior, Carpaint_roof, EXT_Akrapovic_CARBON
HasDetailNormals = 1
UseCarbonDetails = 1
UseClearCoat=1
ClearCoatSmoothness=1
Reflectance = 0.3
DetailNormalBlend = 0.4
BrightnessAdjustment = 0.34
AmbientSpecular = 0.25        ; ambient specular by Stereo
AmbientSpecularEXP = 40     ; concentration of specular ambient
FresnelMax = 0.08             ; how reflective is the car at glancing angles
FresnelC = 0.03  
DetailScale=290

[Material_Metal_v2]
Materials = INT_Decals_METAL_ALuminium 
BrightnessAdjustment = 1
DetailScale = 0
Metalness = 0.30
Reflectance = 0.50
LocalReflectionsSharpness = 0.1

[EXHAUST_FLAMES]
ANTILAG=1.0
ANTILAG_DELAY=0.02
ANTILAG_INTENSITY=5
ANTILAG_INTERVAL_MAX=10.0
ANTILAG_INTERVAL_MIN=0.0
ANTILAG_TURBO_THRESHOLD=0.4
DAMAGE=0
DAMAGE_DURATION=0.00
DAMAGE_INTENSITY=0
DAMAGE_PROBABILITY=0
DISCHARGE=1
DISCHARGE_CHARGE_TIME=0.2
DISCHARGE_DELAY=0.02
DISCHARGE_DURATION=1
DISCHARGE_INTENSITY=7
DISCHARGE_PROBABILITY=0.2
DISCHARGE_RPM_THRESHOLD_MAX=7500
DISCHARGE_RPM_THRESHOLD_MIN=6700
DISCHARGE_WATER_TEMPERATURE_THRESHOLD=75
FLAT_SHIFT=0
FLAT_SHIFT_COOLDOWN=0.5
FLAT_SHIFT_DURATION=0.01
FLAT_SHIFT_GAS_THRESHOLD=70
FLAT_SHIFT_INTENSITY=0.25
FLAT_SHIFT_PROBABILITY=0.4
FLAT_SHIFT_RPM_THRESHOLD=6500
LIMITER=1
LIMITER_DELAY=0.0
LIMITER_INTENSITY=1
LIMITER_RPM_THRESHOLD=7300

[INCLUDE: common/materials_glass.ini]
[Material_Glass]
Materials= INT_Glass_Display
FilmIOR=2.2
ThicknessMult=1

[Material_Glass]
Materials=EXT_Glass_Emissive_Rear
FilmIOR=2.2
MaskPass = 3            ; mask pass opacity
MaskPassColor = 255, 0, 0  ; mask pass color adjustment
ThicknessMult=1.8

[BRAKEDISC_FX]
ACTIVE = 1             ; set to 0 to disable the whole thing if car uses ksBrakeDisc shader for something else
CERAMIC = 1            ; use ceramic look
CARVED = 0             ; add a bit of carving, radial lines (fast for shader to compute)
CARVED_FREQUENCY = 20  ; increase to make more lines
GLOW_OFFSET = 0.8      ; increase to offset heated and worn center more to the center, decrease to offset it more to the outside area; with 0.5, it would be in the middle

; Patch guesses holes from alpha-channel of txDiffuse. Holes don’t glow or reflect stuff and look dark:
ALPHA_MASK = 0.1, 0.2  ; hole is everything with alpha below 0.1, everything with alpha above 0.2 is not a hole, in-between is a transition

; Patch can also estimate deepenings based on luminance and normal texture. Deepenings glow with a delay (but fully heated, glow more) and are a bit occluded:
LUMINOCITY_MASK = 0.01, 0.02  ; everything darker than 0.01 is a deepening
NORMAL_MASK = 0.5, 0.3        ; everything looking away more than 50% is a deepening

[Material_Glass]
Meshes=EXT_Glass_Rear_Outer
IOR = 1.460              ; looks better like this
FilmIOR = $IOR       ; redefine IOR for external film layer to increase reflections
ThicknessMult = 3.5  ; thicker glass passes less light through
ProfileFix = 0.04    ; adds thickness to glass for glazing angles
MaskPass = 5            ; mask pass opacity
MaskPassColor = 255, 0, 0  ; mask pass color adjustment

[INCLUDE: common/materials_carpaint.ini]
CarPaintMaterial = Carpaint
DisableDev = 1

[Material_Carbon]
Materials=Carbon
HasDetailNormals = 1
UseCarbonDetails = 1
BrightnessAdjustment = 0.05
AmbientSpecular = 0.35        ; ambient specular by Stereo
AmbientSpecularEXP = 50     ; concentration of specular ambient
FresnelMax = 0.07             ; how reflective is the car at glancing angles
FresnelC = 0.02              ; how much of that reflection is there on surface facing viewer
UseClearCoat = 1
ClearCoatSmoothness = 1.5
ClearCoatIntensity = 1.0
DetailScale=1000
Reflectance = 0.3
CubemapReflectionBlur = 0.35

[Material_Carbon]
Materials=Carbon_2
HasDetailNormals = 1
UseCarbonDetails = 1
BrightnessAdjustment = 0.05
AmbientSpecular = 0.35        ; ambient specular by Stereo
AmbientSpecularEXP = 50     ; concentration of specular ambient
FresnelMax = 0.07             ; how reflective is the car at glancing angles
FresnelC = 0.02              ; how much of that reflection is there on surface facing viewer
UseClearCoat = 1
ClearCoatSmoothness = 1.5
ClearCoatIntensity = 1.0
DetailScale=400
Reflectance = 0.3
CubemapReflectionBlur = 0.35

[Material_Carbon]
Materials=INT_Carbon
HasDetailNormals = 1
UseCarbonDetails = 1
BrightnessAdjustment = 0.05
AmbientSpecular = 0.35        ; ambient specular by Stereo
AmbientSpecularEXP = 50     ; concentration of specular ambient
FresnelMax = 0.07             ; how reflective is the car at glancing angles
FresnelC = 0.02              ; how much of that reflection is there on surface facing viewer
UseClearCoat = 1
ClearCoatSmoothness = 1.5
ClearCoatIntensity = 1.0
DetailScale=1500
Reflectance = 0.3
CubemapReflectionBlur = 0.35

[Material_Carbon]
Materials=INT_Carbon.001
HasDetailNormals = 1
UseCarbonDetails = 1
BrightnessAdjustment = 0.05
AmbientSpecular = 0.35        ; ambient specular by Stereo
AmbientSpecularEXP = 50     ; concentration of specular ambient
FresnelMax = 0.07             ; how reflective is the car at glancing angles
FresnelC = 0.02              ; how much of that reflection is there on surface facing viewer
UseClearCoat = 1
ClearCoatSmoothness = 1.5
ClearCoatIntensity = 1.0
DetailScale=1000
Reflectance = 0.3
CubemapReflectionBlur = 0.35

[Material_Carbon]
Materials=INT_Carbon.001
HasDetailNormals = 1
UseCarbonDetails = 1
BrightnessAdjustment = 0.05
AmbientSpecular = 0.35        ; ambient specular by Stereo
AmbientSpecularEXP = 50     ; concentration of specular ambient
FresnelMax = 0.07             ; how reflective is the car at glancing angles
FresnelC = 0.02              ; how much of that reflection is there on surface facing viewer
UseClearCoat = 1
ClearCoatSmoothness = 1.5
ClearCoatIntensity = 1.0
DetailScale=1000
Reflectance = 0.3
CubemapReflectionBlur = 0.35