Kenshi
Native Stylise
This topic has been locked
Bob  [developer] 28 Jan, 2024 @ 9:08am
Fog, Dust and Water Fix
UPDATE: The Outline and SSAO shaders have been updated to work better in the main render pipeline. Anyone who implemented the previous version of the fix should update as per below to avoid blending issues.

One of the main issues with modding in shaders is that they all run in PostProcessing, where as water and fog etc run as part of the main lighting pass, so they are always "underneath" modded shaders.

Unfortunately, if I try to overwrite that pass as a mod it reports a duplicate and crashes so the only way to run before fog would be to edit that main compositor manually.

If you are interested, you can make a backup of:
Kenshi/data/materials/compositors/main.compositor

Then, in the original file, replace "compositor_node Lighting_HDR" with:
compositor_node Lighting_HDR { in 0 rt_input in 1 rt_reflection in 2 rt_interiormask texture rt_hdr target_width target_height PF_R11G11B10_FLOAT no_fsaa // Render main and lights target rt_hdr { // Sky and Moons pass render_scene{ lod_update_list off rq_first 1 rq_last 10 } // Lighting passes pass custom MainLight {} // SSAO pass pass render_quad { material SSAOD } // Outline pass pass render_quad { material Comic } // Water pass render_scene { lod_update_list off rq_first 81 rq_last 82 } // Atmosphere fog pass pass render_quad { use_quad yes material AtmosphereFogMaterial } // Fog volumes and Particles pass render_scene { lod_update_list off rq_first 82 rq_last 85 } } out 0 rt_input out 1 rt_hdr }


Or, If you only wanted SSAOD =>
compositor_node Lighting_HDR { in 0 rt_input in 1 rt_reflection in 2 rt_interiormask texture rt_hdr target_width target_height PF_R11G11B10_FLOAT no_fsaa // Render main and lights target rt_hdr { // Sky and Moons pass render_scene{ lod_update_list off rq_first 1 rq_last 10 } // Lighting passes pass custom MainLight {} // SSAO pass pass render_quad { material SSAOD } // Water pass render_scene { lod_update_list off rq_first 81 rq_last 82 } // Atmosphere fog pass pass render_quad { use_quad yes material AtmosphereFogMaterial } // Fog volumes and Particles pass render_scene { lod_update_list off rq_first 82 rq_last 85 } } out 0 rt_input out 1 rt_hdr }

This will force the game to render Outlines and SSAOD before water, fog and particles etc.

Then, DISABLE Outlines and SSAOD in the graphics menu, so they don't render twice.

IMPORTANT: If unsubscribing, remember to replace the original file with the backup.
Last edited by Bob; 6 Apr, 2024 @ 5:25am