[GENERAL]
MODE = AUTO      ; possible values: AUTO, CAR, TRACK
CPU_ONLY = AUTO  ; set to 1 to force baking on CPU
USE_V4 = AUTO    ; patches with v4 take less space and load faster, but don’t allow to adjust lighting in Config.ini after baking
                 ; with AUTO, v4 will be used only if CUDA acceleration is available: CUDA is fast enough so it wouldn’t be a problem to just 
                 ; rebake things if needed.

; -----
; Parameters for cars:
; -----

[MODE_CAR]
EXCLUDE_FROM_BAKING = engine_20, shocks, rear_suspension01, reardiff, engine_19, bmw_e36m3_exhaust_002, brake_light_002, bmw_e36m3_97_wing_002, GEO_TYRE_LF, susp_lf_001, jante, Disk_LF_Satic, GEO_TYRE_LF001, susp_lr, Disk_LR_Satic, jante1, GEO_TYRE_LF002, Disk_RR_Satic, susp_rr, jante2, Disk_RF_Satic, jante3, susp_rf_001, GEO_TYRE_LF003, SUSP_RF_OBJ, SUSP_RR_002, SUSP_LR_002, SUSP_LF_OBJ, TEMP_Needle_Clear, Fuel_Needle_Clear, Fuel_Needle, TEMP_Needle, Speed_Needle_Clear, RPM_Needle_Clear, Speed_Needle, rpm_emissive, RF_Wheel_Cap_BLUR, Lip_Blur_Rf, rim_blur_rf, RR_Wheel_Cap_BLUR, Lip_Blur_Rr, rim_blur_rr, LR_Wheel_Cap_BLUR, Lip_Blur_Lr, rim_blur_lr, LF_Wheel_Cap_BLUR, rim_blur_lf, Lip_Blur_Lf, Steer_Metal, LOGO, bmw_e36m3_97_cockpit_interior_reflector___246_vertices_251_face,  bmw_e36m3_97_cockpit_interior_digital_gauge___14_vertices_12_fa, MPG_Cluster, MPG, temp_gauge_part_00, fuel_gauge_part_00, gauge_RPM_part_00, speed_needle_part_00, E36coupe_fender_FR_SUB0, E36coupe_fender_FL_SUB0, E36coupe_hood, E36coupe_bumper_F_SUB1, E36coupe_grille_SUB2, wheelInter, wheelOuter001, GEO_Tire_LF, E36coupe_door_FL_SUB1, bmw_e36m3_97_cockpit_mirrorL_body___692_vertices_1670_faces, Object014, E36coupe_body_SUB10, E36coupe_door_FL_SUB5, glass_outside, E36coupe_door_FL_SUB6, glass_inside, E36coupe_trunklid_SUB0, E36coupe_bumper_R_SUB1, e36_rear_wing_custom_002, bmw_e36m3_97_lod0_glassRTL_lights_glass___787_vertices_1751_fac001, geo_plate, wheelInter002, wheelOuter003, GEO_Tire_LR, wheelInter003, wheelOuter004, GEO_Tire_RR, E36coupe_door_FR_SUB1, E36coupe_door_FR_SUB5, E36coupe_door_FR_SUB6, bmw_e36m3_97_cockpit_mirrorR_body___692_vertices_1666_faces, Object002_002, GEO_Tire_RF, wheelInter001, wheelOuter002, light_int_GAUGES, bmw_e36m3_97_cockpit_interior_glass___87_vertices_157_faces_002, headlight_Lenzes, High_beam_Lenzes, LF_Wheel_Cap, LR_Wheel_Cap, RR_Wheel_Cap, RF_Wheel_Cap ; meshes to exclude from baking (they would still cast shadows)
FORCE_PASSING_LIGHT =   glass_inside, glass_outside, E36coupe_door_FL_SUB5,  E36coupe_door_FL_SUB6,  E36coupe_door_FR_SUB5, E36coupe_door_FR_SUB6, bmw_e36m3_97_cockpit_interior_glass___87_vertices_157_faces_002 , bmw_e36m3_97_lod0_glassRTL_lights_glass___787_vertices_1751_fac001, bmw_e36m3_97_lod0_glassRTL_lights_glass___787_vertices_1751_fac,  E36coupe_body_SUB11 , bmw_e36m3_97_lod0_glassLHL_lights_glass___175_vertices_319_face, bmw_e36m3_97_lod0_glassLHL_lights_glass___175_vertices_319_face001 , Object002 , headlight_Lenzes, High_beam_Lenzes        ; meshes which won’t cast shadows (plus, all semi-transparent meshes won’t cast shadows by default)
FORCE_ALPHA_TEST_PASSING_LIGHT = 1                    ; stops meshes with alpha testing from casting shadows
NORMALS_Y_BIAS = 0.0                                  ; tilt normals up by this amount during loading

; To stop shadows to look weird for rotating objects, spin them during baking
ROTATING_X = WHEEL_LF, WHEEL_LR, WHEEL_RF, WHEEL_RR, car_hood  ; objects rotating by X axis
ROTATING_Y =  car_door_L, car_door_R                                      ; objects rotating by Y axis
ROTATING_Z = ; STEER_HR , fan , LEFT_WIPER_1, RIGHT_WIPER_1 , Turnsgnals_stalk            ; objects rotating by Z axis (with AO splitting, steering wheel is processed differently)
ROTATING_STEP = 60                                   ; rotate by step and take a shot, and do it again until full circle (in degress)
ROTATING_MIXING = AVERAGE                            ; possible values: AVERAGE, MAX

; Similar thing with animations
ANIMATIONS = BRAKE.ksanim, car_door_L.ksanim, car_door_R.ksanim, car_hood.ksanim, car_shift.ksanim, car_trunk.ksanim, car_wiper.ksanim, CLUTCH.ksanim, GAS.ksanim, GEAR1.ksanim, GEAR2.ksanim, GEAR3.ksanim, GEAR4.ksanim, GEAR5.ksanim, GEARR.ksanim, Left_Blinker.ksanim, Right_Blinker.ksanim, lights.ksanim, MPG_GAUGE.ksanim, Wipers_Lever.ksanim ; with AO splitting, it’s better to bake actually played animations
ANIMATIONS_LOAD_WINGS = 1      ; add wing animations to ANIMATIONS value
ANIMATIONS_STEPS = 0.5, 1.0    ; snap to next point in this list and take a shot, and do it again until the list is done
ANIMATIONS_MIXING = MAX        ; possible values: AVERAGE, MAX
ANIMATIONS_MIXING_MULT = 0.95  ; dim animations AO by 5% (needs much more dimming if AO splitting is disabled)

; Override mixing for some objects so animations would make them darker rather that brighter
ANIMATIONS_MIXING_INVERSE = REAR_BUMPER, GEO_RearBumper  ; moving rear wing might cast extra shadows on rear bumper instead of adding more light

; List of cockpit nodes (for cars not putting interior meshes where they should be)
COCKPIT_HR_NODES = COCKPIT_HR
COCKPIT_LR_NODES = 

; Extra offsets to reduce shadowing of overlaying parts
; EXTRA_OFFSET_0_NAMES = Plane002
; EXTRA_OFFSET_0_VALUE = 0.2

; Extra AO adjustments for some objects (formula is AO ^ EXP × MULT + OFFSET”)
; Because of maximum blending, steering wheel will look too bright. Adjusting gamma would fix it nicely, keeping it bright 
; if it should be bright, but making dimmed areas dimmer;
EXTRA_ADJUSTMENT_0_NAMES = STEER_HR
EXTRA_ADJUSTMENT_0_OFFSET = 0.0
EXTRA_ADJUSTMENT_0_MULT = 1.0
EXTRA_ADJUSTMENT_0_EXP = 1.2

; Extra features for car
EXT_SPLIT_AO = 1                         ; split AO into two different types to switch between them dynamically
EXT_INCLUDE_LODS = 1                     ; include LODs to the same “.vao-patch” file
EXT_DISTANT_LODS_INCREASE_OFFSET = 1     ; increase ray offset for distant LODs
EXT_DISTANT_LODS_SKIP_WHEELS = 1         ; skip wheels for distant LODs to reduce artifacts
EXT_DISTANT_LODS_AREA_BASED = 1          ; switch to simpler area-based filtering for distant LODs to reduce artifacts
EXT_RESET_BLURRED = 1                    ; forcefully switch from blurred to static rims before baking
EXT_RESET_COCKPIT_LR = 1                 ; forcefully switch to high-res cockpit before baking
EXT_HIDE_SEATBELT = 1                    ; hide both “CINTURE_OFF” and “CINTURE_ON” before baking to exclude meshes in it from casting shadows
EXT_BAKE_BLURRED = 1                     ; bake blurred rims separately, in rotating pass too
EXT_BAKE_COCKPIT_LR = 1                  ; bake low-res cockpit separately, in animated pass too
EXT_BAKE_SEATBELT = 1                    ; bake seatbelt separately, in both states, in animated pass too
EXT_DRIVER_RECEIVES_SHADOWS = 1          ; add AO for driver model
EXT_DRIVER_CASTS_SHADOWS = 1             ; add secondary set of AO for interior with driver in it
EXT_DRIVER_POSITION_WITH_STEER_ANIM = 1  ; position driver with “steer.ksanim” instead of “driver_base_pos.knh”
EXT_DRIVER_BAKE_ANIMS = 1                ; bake steering and shifting animations for driver
EXT_DRIVER_INCLUDE_LOD_B = 1             ; add AO for LOD B of driver model as well
EXT_USE_RIGHT_DOOR_ANIM_IF_NEEDED = 1    ; for cars with driver on the right side, “car_door_R.ksanim” should be used instead of “car_door_L.ksanim”

; Options for baking driver animations (only with “EXT_DRIVER_BAKE_ANIMS”)
DRIVER_ANIMATIONS = steer.ksanim, shift.ksanim, shift_dw.ksanim, shift_uw.ksanim
DRIVER_ANIMATIONS_STEPS = 0.5, 1.0
DRIVER_ANIMATIONS_STEER_STEPS = 0.35, 0.4, 0.45, 0.55, 0.6, 0.65
DRIVER_ANIMATIONS_MIXING = MAX       ; possible values: AVERAGE, MAX
DRIVER_ANIMATIONS_MIXING_MULT = 0.6  ; dim animations AO by 5% (needs much more dimming if AO splitting is disabled)

; Debug
; DUMP_INSTEAD_OF_BAKING = H:/test.obj

; Reduce ground effect for interior
; REDUCED_GROUND_0_NAMES = @COCKPIT_HR, @COCKPIT_LR, DRIVER:DRIVER
; REDUCED_GROUND_0_FACTOR = 0.8  ; with 1.0, it would be as if there is no ground blocking light
REDUCED_GROUND_0_FACTOR = 0.0  ; with 1.0, it would be as if there is no ground blocking light

; Baking params
SAMPLES = AUTO                      ; uses area to guess amount of samples
MIN_SAMPLES_PER_FACE = 10           ; minimum amount of samples per triangle
RAYS_PER_SAMPLE = 128               ; amount of rays to cast for each sample
; MIN_SAMPLES_PER_FACE = 2           ; minimum amount of samples per triangle
; RAYS_PER_SAMPLE = 32               ; amount of rays to cast for each sample
RAYS_OFFSET = 0.005                 ; start a ray not at the surface, but with a bit of offset
USE_GROUND = 0                      ; add ground for occlusing lighting from below
GROUND_SCALE = 1.2                  ; how bigger is ground comparing to a model
FILTER_MODE = LEAST_SQUARES            ; possible values: AREA_BASED, LEAST_SQUARES (better one)
FILTER_REGULARIZATION_WEIGHT = 0.1  ; regularization weight for least squares, positive range
AVERAGING_THRESHOLD = 0.0001        ; merge and average AO for vertices within that distance
AVERAGING_COS_THRESHOLD = 0.92      ; min cosine threshold for averaging

; Post-processing (could be changed later in “.vao-patch” file)
BRIGHTNESS = 1.0  ; brightness multiplier for resulting AO
GAMMA = 0.9       ; gamma, reduce to make AO brighter without altering shadows or clamping
; GAMMA = 1.0       ; gamma, reduce to make AO brighter without altering shadows or clamping
OPACITY = 1.0     ; reduce to make darkest point brighter

; Add shader adjustment to raise ambient brightness to compensate for AO automatically
; BRIGHTER_AMBIENT_EXTERIOR = 1.1
; BRIGHTER_AMBIENT_INTERIOR = 1.8
; BRIGHTER_AMBIENT_DRIVER = 1.8
BRIGHTER_AMBIENT_EXTERIOR = 1.6
BRIGHTER_AMBIENT_INTERIOR = 4.0
BRIGHTER_AMBIENT_DRIVER = 2.0

; EXTRA_ADJUSTMENT_1_NAMES = @COCKPIT_HR, @COCKPIT_LR, DRIVER:DRIVER
; EXTRA_ADJUSTMENT_1_GAMMA = 0.5
; EXTRA_ADJUSTMENT_1_OPACITY = 0.9

; -----
; Parameters for tracks:
; -----

[MODE_TRACK]
EXCLUDE_FROM_BAKING = ?water?, AC_?         ; meshes to exclude from baking (they would still cast shadows)
FORCE_PASSING_LIGHT = shader:ksFlags, AC_?  ; meshes which won’t cast shadows (plus, all semi-transparent meshes won’t cast shadows by default)
FORCE_ALPHA_TEST_PASSING_LIGHT = 0    ; stops meshes with alpha testing from casting shadows
NORMALS_Y_BIAS = 0.5                  ; tilt normals up by this amount during loading

; Additional options for specific track objects
BAKE_AS_GRASS = shader:ksGrass, ?bush?, material:?bush?, ?grass?, material:?grass?  ; grass doesn’t cast any shadows, normals facing up as well
BAKE_AS_TREES = shader:ksTree, ?tree?, material:?tree?, branch?, material:branch?, Branch?, material:Branch?   ; trees don’t cast shadows on trees, and their normals are facing up
TREES_SHADOW_FACTOR = 0.5                                ; reduce shadowing for trees to compensate for lack of texturing support (makes baking slower)

; Baking extra samples for occluding cars
AO_SAMPLES_AI_LANES = 1                       ; use AI lanes as a source for extra samples
AO_SAMPLES_PIT_POINTS = 1                     ; use pit poits as source for extra samples (more sources will be available later)
AO_SAMPLES_AI_LANES_Y_OFFSET = 0.3, 0.5, 1.0  ; offset by Y axis for samples taken from AI lanes (AO with brightest value will be used)
AO_SAMPLES_AI_LANES_SIDES = 0.67              ; generate extra points from AI, to left and right, with this much offset
AO_SAMPLES_AI_LANES_PITLINE_WIDTH = 4.0       ; pitlane width for extra samping around pitlane AI lane
AO_SAMPLES_AI_LANES_MIN_DISTANCE = 4          ; min distance between points (reduce for more detailed sampling)

; Extra features for tracks
EXT_EXCLUDE_POBJECTS = 1  ; exclude dynamic objects (they will be shadowed separately later on)

; Baking params
SAMPLES = AUTO                      ; uses area to guess amount of samples
MIN_SAMPLES_PER_FACE = 6            ; minimum amount of samples per triangle
RAYS_PER_SAMPLE = 64                ; amount of rays to cast for each sample
RAYS_OFFSET = 0.4                   ; start a ray not at the surface, but with a bit of offset
USE_GROUND = 1                      ; add ground for occlusing lighting from below
GROUND_SCALE = 2                    ; how bigger is ground comparing to a model
FILTER_MODE = AREA_BASED            ; possible values: AREA_BASED, LEAST_SQUARES (better one, but sometimes might produce more artifacts)
FILTER_REGULARIZATION_WEIGHT = 0.1  ; regularization weight for least squares, positive range
AVERAGING_THRESHOLD = 0.1           ; merge and average AO for vertices within that distance
AVERAGING_COS_THRESHOLD = 0.78      ; min cosine threshold for averaging

; Post-processing (could be changed later in “.vao-patch” file)
BRIGHTNESS = 1.0  ; brightness multiplier for resulting AO
GAMMA = 0.9      ; gamma, reduce to make AO brighter without altering shadows or clamping
OPACITY = 0.95    ; reduce to make darkest point brighter

; -----
; Custom parameters for different models, as an example or for some sort of universal config.
; -----

[SPECIFIC_...]
DESCRIPTION = shadow on car body from rear wing animation
CAR = ks_mclaren_p1
SPLIT_AO__WING_ANIM_0_NODES = g_Body, @AUTO

[SPECIFIC_...]
DESCRIPTION = fix for car body having too many shadows
CAR = chaparral_2j
EXTRA_OFFSET_2_NAMES = Plane002
EXTRA_OFFSET_2_VALUE = 0.2

[SPECIFIC_...]
DESCRIPTION = fix for surfaces having too many shadows
TRACK = srp_daikoku
EXTRA_OFFSET_2_NAMES = material:concrete_floor, material:asphaltalpha
EXTRA_OFFSET_2_VALUE = 10
EXTRA_ADJUSTMENT_1_NAMES = material:asphaltalpha
EXTRA_ADJUSTMENT_1_OFFSET = 0.2
EXTRA_ADJUSTMENT_1_MULT = 0.8
EXTRA_ADJUSTMENT_2_NAMES = material:concrete_floor
EXTRA_ADJUSTMENT_2_OFFSET = 0.5
EXTRA_ADJUSTMENT_2_MULT = 0.5

[SPECIFIC_...]
DESCRIPTION = fix for surfaces having too many shadows
TRACK = fonteny
EXTRA_OFFSET_2_NAMES = material:cobbles
EXTRA_OFFSET_2_VALUE = 10
; EXTRA_ADJUSTMENT_1_NAMES = material:asphaltalpha
; EXTRA_ADJUSTMENT_1_OFFSET = 0.2
; EXTRA_ADJUSTMENT_1_MULT = 0.8
; EXTRA_ADJUSTMENT_2_NAMES = material:concrete_floor
; EXTRA_ADJUSTMENT_2_OFFSET = 0.5
; EXTRA_ADJUSTMENT_2_MULT = 0.5

[SPECIFIC_...]
DESCRIPTION = fix for car not using COCKPIT_HR correctly
CAR = tipo61
COCKPIT_HR_NODES = COCKPIT_HR, Seat, interiormetal, frame, dash, bridge, details, gear, SHIFT_HD

; [SPECIFIC_...]
; DESCRIPTION = fix for trunk animation
; CAR = drks_vw_golf7_r_s2
; ANIMATIONS_MIXING_INVERSE = anim_trunk

; -----
; Everything else not starting with “MODE_” and “SPECIFIC_” will be included in resulting “Config.ini”. You can use it to adjust materials 
; with supported in VAO patches “SHADER_REPLACEMENT_…”:
; -----

; [SHADER_REPLACEMENT_...]
; MATERIALS = INT_OCC_SKIN_Grey, INT_OCC_Carpaint, INT_OCC_CARBON_Base, INT_OCC_RUBBER_Rollbar, INT_DETAILS_PLASTIC_NM, INT_DETAILS_FLAT_AT_NM, INT_OCC_METAL_Black, INT_OCC_ALCANTARA, INT_Decals_logos_Reflective, INT_DETAILS_METAL_NM, INT_Belts, INT_OCC_FABRIC_Seat, INT_OCC_PLASTIC_Grey, INT_Decals_logos_FLAT
; PROP_0 = ksAmbient, *2.5

[SPLIT_AO]
STEERING_WHEEL_NODES = STEER_HR, STEER_LR
COCKPIT_HR = @COCKPIT_HR

; @AUTO will be replaced by list of nodes directly affected by animation
HEADLIGHTS_NODES = @AUTO
HEADLIGHTS_EXP = 2.0
DOOR_NODES = @COCKPIT_HR, @COCKPIT_LR, @AUTO
DOOR_EXP = 2.0

; By default AO splitting is not used for wing animations. You can set animations here.
WING_ANIM_0_NAME = car_rear_wing.ksanim
WING_ANIM_0_NODES = REAR_BUMPER, GEO_RearBumper, @AUTO
WING_ANIM_0_EXP = 1.0
