______________________________BMW X5 E53 4.8is__________________________
[INCLUDE]
INCLUDE=common/no_popup_lights.ini, common/dev_material_carpaint.ini, 
[INCLUDE: common/custom_emissive.ini]
[INCLUDE: common/materials_license_plate.ini]
[Material_LicensePlate_Europe]

[PARTICLES_FX]
SMOKE_BLOCK_START=0.4
SMOKE_BLOCK_END=0.6

[REFLECTIONS_FX]
ALLOW_INTERIOR_SSAO=0
ALLOW_INTERIOR_SSGI=0
AUTOFIX=1
MASK_CUBEMAP_ENABLED=1
MASK_CUBEMAP_OFFSET=0, -0.1, 0.2
MASK_CUBEMAP_TWEAK=0.5


_____________________________________________________________________

[AUDIO_PROPERTIES]
ENGINE_EXT_BOOST=0
ENGINE_INT_BOOST=0
TURBO_THROTTLE=1

[AUDIO_VOLUME]
BACKFIRE_EXT=1
BACKFIRE_INT=1
BODYWORK=1
DIRT=1
DOWN_SHIFT=1
ENGINE_EXT=1
ENGINE_INT=1
GEAR_EXT=1
GEAR_GRIND=1
GEAR_INT=1
HORN=1
LIMITER=1
TRACTION_CONTROL_EXT=0
TRACTION_CONTROL_INT=0
TRANSMISSION=1
TURBO=1
WIND=1

[AUDIO_PITCH]
ENGINE_EXT = 1.00
ENGINE_INT = 1.00
GEAR_EXT = 1.0
GEAR_INT = 1.0
BODYWORK = 1.0
WIND = 1.0
DIRT = 1.0
DOWN_SHIFT = 1.0
HORN = 1
GEAR_GRIND = 1.0
BACKFIRE_EXT = 1
BACKFIRE_INT = 1
TRACTION_CONTROL_EXT = 1
TRACTION_CONTROL_INT = 1
TRANSMISSION = 1
LIMITER = 1
TURBO = 2.0
HIT = 1
SCRAPE = 1
WHEEL = 1
SKID_EXT = 1
SKID_INT = 1

____________________________________________________________________



[TYRES_FX]
BROKEN_TYRES_DYNAMIC=1

[SHADOWED_WHEELS_FRONT]
AFFECT_SUSP_NODES=1
ANGLE_X=0
BOUND_TO_SUSPENSION=0
DISTANCE=3
EXTRA_AMBIENT_BRIGHTNESS=0.12
OFFSET=0.04
WIDTH=0.1

[SHADOWED_WHEELS_REAR]
AFFECT_SUSP_NODES=1
ANGLE_X=0
BOUND_TO_SUSPENSION=0
DISTANCE=3
EXTRA_AMBIENT_BRIGHTNESS=0.12
OFFSET=0.04
WIDTH=0.1


[LIGHT_FLAME_0] ; Flame Brightness
BRIGHTNESS_MULT=1
CAR_BRIGHTNESS_MULT=1
CAR_RANGE_MULT=1
COLOR=5,1,1,1
DEBUG=0
DIRECTION_MULT=1, 1, 1
FADE_AT=150
FADE_SMOOTH=30
OFFSET=0.2
RANGE=7
RANGE_GRADIENT_OFFSET=0.2
SPOT=238.322
SPOT_SHARPNESS=0.0

[EXHAUST_FLAMES] ; CSP Flames Configuration
ANTILAG=0 ; turbo antilag, i havent tested this yet
ANTILAG_DELAY=0.0 ; how long after antilag trigger do flames start, in seconds
ANTILAG_INTENSITY=10 ; flame size
ANTILAG_INTERVAL_MAX=7000
ANTILAG_INTERVAL_MIN=65000
ANTILAG_TURBO_THRESHOLD=0.0
DAMAGE=0 ; engine damage? idk
DAMAGE_DURATION=0.00
DAMAGE_INTENSITY=0
DAMAGE_PROBABILITY=0
DISCHARGE=1 ; lifting off the throttle
DISCHARGE_CHARGE_TIME=0.1 ; how long you have to press the throttle to "charge" the flames
DISCHARGE_DELAY=0.1 ; delay after throttle lift
DISCHARGE_DURATION=0.55 ; length of flame shooting, in seconds
DISCHARGE_PROBABILITY=1; chance of flame shoot on lift, 1 is guaranteed, 0 is never
DISCHARGE_INTENSITY=1; flame size
DISCHARGE_RPM_THRESHOLD_MAX=7200 ; self explanatory
DISCHARGE_RPM_THRESHOLD_MIN=2000 ; self explanatory
DISCHARGE_WATER_TEMPERATURE_THRESHOLD=70
FLAT_SHIFT=1 ; on upshift
FLAT_SHIFT_COOLDOWN=0 ; after upshift
FLAT_SHIFT_DURATION=0.1 ; length of flame shooting, in seconds
FLAT_SHIFT_GAS_THRESHOLD=50 ; how much gas needs to be pressed on upshift for flame, 100 is wide open
FLAT_SHIFT_INTENSITY=.1 ; flame size
FLAT_SHIFT_PROBABILITY=.3 ; chance of flame shoot on upshift
FLAT_SHIFT_RPM_THRESHOLD=6500
LIMITER=1 ; on hitting the limiter
LIMITER_DELAY=0.2 ; delay, in seconds
LIMITER_INTENSITY=.1 ; flame size
LIMITER_RPM_THRESHOLD=7400 ; limiter flames will not shoot below this rpm

_____________________________________________________Lights front__________________

[BOUNCED_BRAKE_LIGHTS]
ACTIVE=1
FADE_AT=200
FADE_SMOOTH=50
FALLOFF=0.7
GRADIENT_OFFSET=0.8
MULT=1, 1, 1, 1
OFFSET=7

[BOUNCED_HEADLIGHTS]
ACTIVE=1
FADE_AT=200
FADE_SMOOTH=50
FALLOFF=0.7
GRADIENT_OFFSET=0.8
MULT=1, 1, 1, 1
OFFSET=7

[BOUNCED_INTERIOR_LIGHT]
ACTIVE=1
DIRECTION=0, 1, -2
MULT=1, 1, 1, 1
OFFSET=0, -1, 3
RANGE=3.2
RANGE_GRADIENT_OFFSET=0.9
SPOT=20
SPOT_SHARPNESS=0.9

[LIGHTING]
EMISSIVE_BRAKELIGHTS_MULT=1
EMISSIVE_HEADLIGHTS_MULT=2
EMISSIVE_MULT=1
EMISSIVE_PARKINGLIGHTS_MULT=1
INTERIOR_DARKEN_LIGHT=1
INTERIOR_DARKEN_SPECULAR=0.1
INTERIOR_FAKE_SHADOW_FADE=0.2
INTERIOR_FAKE_SHADOW_HEIGHT=0.1
INTERIOR_FAKE_SHADOW_OPACITY=0.1
INTERIOR_FAKE_UPPER_SHADOW_FADE=0.1
INTERIOR_FAKE_UPPER_SHADOW_HEIGHT=-0.1
LIT_MULT=1
SPECULAR_MULT=1



[LIGHT_EXTRA_0]
BIND_TO_BRAKELIGHTS=0
BIND_TO_HEADLIGHTS=1
COLOR=1, 1, 1, 7
DIFFUSE_CONCENTRATION=0.88
DIRECTION=0, 0,-1
EXTERIOR_ONLY=0
FADE_AT=7
FADE_SMOOTH=2
INTERIOR_ONLY=0
MIRROR=0
POSITION=0.64, 0.8, 2.35
RANGE=0.2
RANGE_GRADIENT_OFFSET=0.75
SPECULAR_MULT=1
SPOT=0
SPOT_EDGE=0, 0, 0
SPOT_EDGE_SHARPNESS=10
SPOT_SHARPNESS=0

[LIGHT_EXTRA_1]
BIND_TO_BRAKELIGHTS=0
BIND_TO_HEADLIGHTS=1
COLOR=1, 1, 1, 7
DIFFUSE_CONCENTRATION=0.88
DIRECTION=0, 0,-1
EXTERIOR_ONLY=0
FADE_AT=7
FADE_SMOOTH=2
INTERIOR_ONLY=0
MIRROR=0
POSITION=-0.66, 0.8, 2.35
RANGE=0.2
RANGE_GRADIENT_OFFSET=0.75
SPECULAR_MULT=1
SPOT=0
SPOT_EDGE=0, 0, 0
SPOT_EDGE_SHARPNESS=10
SPOT_SHARPNESS=0

[LIGHT_EXTRA_2]
BIND_TO_BRAKELIGHTS=1
BIND_TO_HEADLIGHTS=0
COLOR=10, 1, 0, 2
DIFFUSE_CONCENTRATION=0.88
DIRECTION=0, 0,-1
EXTERIOR_ONLY=0
FADE_AT=7
FADE_SMOOTH=2
INTERIOR_ONLY=0
MIRROR=0
POSITION=-0.8, 0.92, -2.3
RANGE=0.2
RANGE_GRADIENT_OFFSET=0.75
SPECULAR_MULT=1
SPOT=0
SPOT_EDGE=0, 0, 0
SPOT_EDGE_SHARPNESS=10
SPOT_SHARPNESS=0

[LIGHT_EXTRA_3]
BIND_TO_BRAKELIGHTS=1
BIND_TO_HEADLIGHTS=0
COLOR=10, 1, 0, 2
DIFFUSE_CONCENTRATION=0.88
DIRECTION=-1, 0,-1
EXTERIOR_ONLY=0
FADE_AT=7
FADE_SMOOTH=2
INTERIOR_ONLY=0
MIRROR=0
POSITION=0.8, 0.92, -2.3
RANGE=0.2
RANGE_GRADIENT_OFFSET=0.75
SPECULAR_MULT=1
SPOT=0
SPOT_EDGE=0, 0, 0
SPOT_EDGE_SHARPNESS=10
SPOT_SHARPNESS=0

[LIGHT_HEADLIGHT_0]
AFFECTS_TRACK=1
COLOR=1,1, 1.05, 9
DIFFUSE_CONCENTRATION=1
DIRECTION=0, -0.2, 1
EXTERIOR_ONLY=0
FADE_AT=450
FADE_SMOOTH=50
INTERIOR_ONLY=0
MIRROR=0.6
OFF_COLOR=1, 1, 1, 0
OFF_FADE_MULT=0.716441
OFF_MIRROR=0.592042
OFF_MULT=0
OFF_POSITION=0, 0.649401, 1.70774
OFF_RANGE_MULT=0.104929
POPUP_EDGE_EXP=0.3
POPUP_EDGE_OFFSET=0.5
POPUP_ENABLED=1
POPUP_END=0.7
POPUP_SECOND_SPOT_EXP=0.6
POPUP_SECOND_SPOT_INITIAL_VALUE=0.4
POPUP_START=0.05
RANGE=300				;Distancia de largas
RANGE_GRADIENT_OFFSET=0
SECOND_SPOT=90
SECOND_SPOT_INTENSITY=1.
SECOND_SPOT_RANGE=60                   ;Distancia de cortas
SECOND_SPOT_SHARPNESS=0.5
SECOND_SPOT_SKIP=0
SPECULAR_MULT=0
SPOT=75					; Angulo de vision lateral
SPOT_EDGE=0.034096, 0.033264, 0.0316
SPOT_EDGE_SHARPNESS=44.6667
SPOT_SHARPNESS=.0
SPOT_UP=0.0499376, 0.698752, 0
LOWBEAM_RANGE_MAX=55
LOWBEAM_RANGE_MULT=1
LOWBEAM_RANGE_ONCOMING_MULT=1

[EMISSIVE_HIGHBEAM_...]
NAME=Object015
COLOR=290,295,110, 1.0
LAG=0.6
SIMULATE_HEATING=0.6
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5


[EMISSIVE_LIGHT_...] 
NAME= object_vehicle_lightsemissive_sps
COLOR=150, 150, 150
LAG=0.1
SIMULATE_HEATING=0
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=1


[EMISSIVE_LIGHT_...] 
NAME=object_vehicle_lightsemissive_sps01
COLOR=40, 30, 10
OFF_COLOR=40, 30, 10
LAG=0.1
SIMULATE_HEATING=0
LOCATION=FRONT
CAST_LIGHT=1
CLUSTER_THRESHOLD=1

[EMISSIVE_LIGHT_...] 
NAME=Object020, object_vehicle_lightsemissive_sps04, STEER_HR_mesh_SUB3, object_vehicle_lightsemissive, RPM_NEEDLE, SPEED_NEEDLE, OIL_TEMP_NEEDLE, FUEL_NEEDLE
COLOR=2, 1, 0
LAG=0.1
SIMULATE_HEATING=0
LOCATION=INTERIOR
CAST_LIGHT=1
CLUSTER_THRESHOLD=1


[EMISSIVE_BRAKE_...] 
NAME=object_vehicle_lightsemissive_sps07
COLOR=120, 20, -10,3
LAG=0.0
SIMULATE_HEATING=0
LOCATION=REAR
CAST_LIGHT=1
CLUSTER_THRESHOLD=0.5


_________________________________________

; New car paint
[INCLUDE: common/materials_carpaint.ini]
CarPaintMaterial = paint
CarPaintVersionAware = 4
DisableDev = 1



[Material_CarPaint_Metallic]

[Material_CarPaint_Matte]
Skins = Grey_matte, Kingfisher_Blue

; New glass
[INCLUDE: common/materials_glass.ini]
ExteriorGlassTintedMaterials = window

[SHADER_REPLACEMENT_0_GLASSTEST : Material_PhotoelasticGlass]
ACTIVE = $" read('csp/version', 0) >= 1279 "
Materials = window
FilmIOR = 2.2
ThicknessMult = 0.5
Desaturate = 1
MaskPass = 2

[Material_Glass]
Materials = glass, 
Meshes = Mesh66
FilmIOR = 2.2
____________________________________________________

; New interior materials
[INCLUDE: common/materials_interior.ini]
DisableDev = 1

[Material_DigitalScreen]
Meshes = INT_HMI_ACC_Mesh_19
MatrixType = LCD
ScreenScale = 3000
ScreenAspectRatio = 1
UseTextureCoordinates = 0

[Material_Leather]
Materials = leather_seat
Smoothness = 0.4

[Material_DashboardLeather]
Materials = leather_dash

[Material_Carpet]
Materials = alcant

[Material_Fabric]
Materials = fabric

[SHADER_REPLACEMENT_...]
MATERIALS = black, cupra_color
PROP_... = extExtraSharpLocalReflections, -0.001
DOUBLE_FACE_SHADOW_BIASED = 1

[Material_AluminiumOld_v2]
Materials =chrome_ext, chrome_int, chrome_ao
DetailScale = 1
Metalness = 0.3
Reflectance = 0.2
Brightness = 0.3

[Material_DigitalScreen]
Meshes =
ScreenScale = 600
ScreenAspectRatio = 0.05
MatrixType = LED
____________________________________________________

[EMISSIVE_REVERSE_0]
NAME = Object024 
COLOR = 20, 20, 20          ; glowing color if condition is met
LAG = 0.73                   ; with zero, turns on and off immediately
SIMULATE_HEATING = 1      ; adds heating effect, going through orange tint while turning on and off
LOCATION = REAR             ; light location used for damage and light guessing, default value depends on type
ACT_AS_HEADLIGHTS = 1       ; if set to 1, emissiveness is raised when camera is caught in car’s headlights

[EMISSIVE_REVERSE_1]
NAME = 
COLOR = 20, 20, 20          ; glowing color if condition is met
LAG = 0.73                   ; with zero, turns on and off immediately
SIMULATE_HEATING = 1      ; adds heating effect, going through orange tint while turning on and off
LOCATION = REAR             ; light location used for damage and light guessing, default value depends on type
ACT_AS_HEADLIGHTS = 1       ; if set to 1, emissiveness is raised when camera is caught in car’s headlights



[SMART_MIRROR]
VISIBLE_FIRSTPERSON = LEFT

[INCLUDE]
INCLUDE=common/no_popup_lights.ini

[LIGHT_LICENSEPLATE]
; no need to specify meshes names if material is using
; Plate_D.dds and Plate_NM.dds textures
MESHES=Plate_LODA
OFFSET=0.00, 0.020, -0.02
RANGE=0.36
RANGE_GRADIENT_OFFSET=0.25
SPOT=170
SPOT_SHARPNESS=0.75
COLOR=3,3,2
FALLBACK_EMISSIVE=5,5,10
; other supported values: TWO_ON_TOP, ONE_ON_TOP
LAYOUT=TWO_ON_TOP
FADE_AT=10
FADE_SMOOTH=4
ACTIVE=1AFFECTS_TRACK=1





________________________________________________________________

[DI_GEAR_...]
DIGITAL_ITEM =2
DIGITAL_ITEM_NUMBER_FORMAT=GEAR_AUTO,R,P,M, , , , , 

[DI_GEAR_...]
DIGITAL_ITEM = 5
DIGITAL_ITEM_NUMBER_FORMAT = GEAR_AUTO, , , M

[DI_GEAR_...]
DIGITAL_ITEM = 0
DIGITAL_ITEM_NUMBER_FORMAT=GEAR, , ,1,2,3,4,5,6

[DI_GEAR_...]
DIGITAL_ITEM =6
DIGITAL_ITEM_NUMBER_FORMAT=GEAR_AUTO,R,P, , , , , , 

________________________________________________________________


[INCLUDE: common/navigators.ini]

[INCLUDE: common/navigators.ini]
[NAVIGATOR_0 : Navigator_StyleModernLight]
ACTIVE = $" read('csp/version', 0) >= 1024"
Meshes = INT_HMI_ACC_Mesh_19
@ = Navigator_Size, Resolution = "1280, 720", Size = "1280, 720", Offset = "0, 0",    
RESOLUTION_LIMIT = 1280, 720
DYNAMIC_OPACITY = 0  ; disabling component from the start, relying on scriptable display to activate it when needed



[SCRIPTABLE_DISPLAY_...] ; Reverse Cam
MESHES =  INT_HMI_ACC_Mesh_19
RESOLUTION = 476, 316 ; matches values in navigator 
DISPLAY_POS = 0, 0
DISPLAY_SIZE = 1280, 720
FORCE_UPDATE_AFTER = RENDERING_CAMERA_0  ; this display is going to be updated each time navigator is drawn
KEEP_BACKGROUND = 1               ; and without clearing step, so we would draw on top of navigator
SCRIPT = '
function update()
  if car.gear ~= -1 then  
    -- If gear is not reverse, activate navigator:
    ac.setDynamicTextureShift("NAVIGATOR_0", 1)  -- this function sets its opacity, it can do more
    ac.setRenderingCameraActive("RENDERING_CAMERA_0", false)  -- pause rendering camera
    return  -- and we’re done here, so let’s stop
  end

  -- Gear is reverse!
  ac.setDynamicTextureShift("NAVIGATOR_0", 0)  -- let’s stop navigator
  ac.setRenderingCameraActive("RENDERING_CAMERA_0", true)  -- activate rendering camera
  display.image{pos = vec2(0, 0), size = vec2(476, 316), image = "dynamic::camera_rear_distorted"}  -- and draw fisheye camera

  -- And we’re done! But for a bit of extra authenticity let’s add lines with trajectory:
  local startL = vec2(60, 250)  -- one thing to note: I haven’t really properly calibrated those lines yet
  local startR = vec2(476 - 60, 250)
  local direction = vec2(35, -25):normalize()
  local lineLen = 160
  local steps = 9
  local steerOffset = -car.steer * 0.12
  local currentPosL = startL
  local currentPosR = startR
  local color = rgbm(1, 0, 0, 1)
  for i = 1, steps do
    local newPosL = startL + direction * (i * (lineLen / steps)) + vec2(steerOffset * (i / steps) ^ 2, 0)
    local newPosR = startR + vec2(-direction.x, direction.y) * (i * (lineLen / steps)) + vec2(steerOffset * (i / steps) ^ 2, 0)
    local drawAcrossColor = color
    if i == 4 then
      color = rgbm(1, 1, 0, 1)
    elseif i == 7 then
      color = rgbm(0, 1, 0, 1)
    else
      drawAcrossColor = i == 9 and color or nil
    end
    ui.drawLine(currentPosL, newPosL, color, 4)
    ui.drawLine(currentPosR, newPosR, color, 4)
    if drawAcrossColor ~= nil then
      ui.drawLine(currentPosL, currentPosR, drawAcrossColor, 4)
    end
    currentPosL = newPosL
    currentPosR = newPosR
    direction:add(vec2(0, 0.02)):normalize()
  end

  -- And a warning:
  display.rect{pos = vec2(40, 276), size = vec2(396, 32), color = rgbm(0, 0, 0, 0.8 )}
  display.text{pos = vec2(40, 286), letter = vec2(12, 20), text = "Check surroundings for safety", font = "aria", width = 396, alignment = 0.5 }
end'

[RENDERING_CAMERA_0]
DYNAMIC_TEXTURE_ID = camera_rear ; here, we will create “dynamic::camera_rear” texture
POSITION = 0, 0.686, -2.09
DIRECTION = 0, -.2, -1
INCLUDE_CAR = 1
REFRESH_RATE = 60  ; doesn’t need to update too often, those in-car cameras are usually pretty nasty
INTERIOR_ONLY = 1  ; stop rendering if camera is not interior one
CLIP_NEAR = 0.005  ; the way it’s positioned, it needs to render things that are very close (bits of car)
FOV = 140         ; huge FOV to get that authentic look
RESOLUTION = 1920 , 1080 ; and massive resolution too
ACTIVE_BY_DEFAULT = 0 ; inactive by default, activated by a script
WITH_LIGHTING = 1
; RELATIVE_TO = DOOR_L

[TEXTURE_PREPROCESSING_...]
DYNAMIC_TEXTURE_ID = camera_rear_distorted ; new “dynamic::camera_rear_distorted” texture
TEXTURE_SOURCE = dynamic::camera_rear ; use previously specificed camera texture
RESOLUTION = 1920, 1080 ; target resolution matches screen one, RESOLUTION for camera is just that multiplied by four
EFFECT = FISHEYE  ; use BASIC if you only need color correction (SATURATION, BRIGHTNESS, etc.)
INTENSITY = 1.5   ; intensity of fisheye effect, adjusted for 170° FOV
EXPOSURE = 0.50      ; this value activates tonemapping to get image from HDR to LDR space
BRIGHTNESS = 1.3  ; a bit dimmer


_________________________________________________________________________________________

[WIPERS]
FRONT_0= tergi_1_1
FRONT_1= tergi_2_1
WIND_THRESHOLDS_KMH = 140, 290  ; speed for wipers to start vibrating and for maximum vibration
WIND_AMPLITUDE_MULT = 1       ; multiplier for amplitude
WIND_FREQUENCY_MULT = 1        ; multiplier for frequency
WIND_OFFSET = 0.03             ; base animation progress to vibrate around

[WIPERS_TRACE_...]
SURFACE = 
WIPERS = geo_tergi_2_2, geo_tergi_1_2

