Implementing Deferred lighting into Source 2013


Having deferred lighting in your mod comes with quite a lot of upsides as with it, you can have volumetric lighting, realtime shadows and lighting from the sun and from other light sources, while still keeping the performance steady which is something that Source's regular dynamic light entities would be incapable of (aka projected textures).
Implementing into your Source 2013SP mod
Now we are going to use Lambda Wars's implementation for it as its an enhanced/upgraded version of Alien Swarm Deferred's, but beware implementing deferred lighting in your mod is extremely complex requiring you to modify client and server side code, and even add new shaders to your game. Among other things source's default shaders are also needed to be modified.
Clientside
Serverside
Shaders

Lamba War's source code Reference project : Source 2013MP deferred this project uses the older Alien swarm deferred's version but it still should give us some idea what needs to be changed.
Cpp files and header files needed to be modified or added
- Client
- cdll_client_int.cpp ,modification needed
- viewrender.h ,modification needed
- viewrender.cpp ,modification needed
- flashlighteffect.h ,modification needed
- flashlighteffect.cpp ,modification needed
- c_entityflame.cpp ,modification needed although it's not necessary it's still a quality of life feature
- deferred ,This folder contents are needed which are:
- cascade_t.cpp
- cascade_t.h
- DefCookieProjectable.cpp
- DefCookieProjectable.h
- DefCookieTexture.cpp
- DefCookieTexture.h
- IDefCookie.h
- IDeferredExtClient.cpp
- cdeferred_manager_client.cpp
- cdeferred_manager_client.h
- clight_editor.cpp
- clight_editor.h
- clight_manager.cpp
- clight_manager.h
- def_light_t.cpp
- def_light_t.h
- deferred_client_common.cpp
- deferred_client_common.h
- deferred_rt.cpp
- deferred_rt.h
- flashlighteffect_deferred.cpp
- flashlighteffect_deferred.h
- viewrender_deferred.cpp
- viewrender_deferred.h
- vgui ,This folder is also needed
- projectable_factory.cpp
- projectable_factory.h
- vgui_deferred.h
- vgui_editor_controls.cpp
- vgui_editor_controls.h
- vgui_editor_props.cpp
- vgui_editor_props.h
- vgui_editor_root.cpp
- vgui_marquee.cpp
- vgui_marquee.h
- vgui_particles.cpp
- vgui_particles.h
- vgui_particles.cpp
- vgui_projectable.cpp
- vgui_projectable.h
- Server
- gameinterface.cpp ,modification needed
- lights.cpp ,modification needed
- EntityFlame.h ,modification needed although it's not necessary it's still a quality of life feature
- deferred ,This folder contents are needed which are:
- cdeferred_manager_server.cpp
- deferred_server_common.h
- cdeferred_manager_server.h
- Shared
- deferred ,This folder contents are needed which are:
- CDefLight.cpp
- CDefLight.h
- CDefLightContainer.cpp
- CDefLightContainer.h
- CDefLightGlobal.cpp
- CDefLightGlobal.h
- deferred_shared_common.cpp
- deferred_shared_common.h
- ssemath_ext.h
- deferred ,This folder contents are needed which are:
- Public
- renderparm.h ,modification needed
Shaders
- common_deferred_fxc.h
- deferred_context.h
- deferred_global_common.h
- deferred_includes.h
- deferred_utility.h
- defpass_composite.h
- defpass_gbuffer.h
- defpass_shadow.h
- IDeferredExt.h
- lighting_helper.h
- lighting_pass_basic.h
- lighting_pass_volum.h
- lightshafts_helper.h
- vertexlitgeneric_dx9_helper.h
- lightmappedgeneric_deferred_ps30.h
- lightmappedgeneric_dx9_helper.h
- debug_lightingctrl.cpp
- debug_radiosity_grid.cpp
- deferred_decalModulate.cpp
- deferred_model.cpp
- deferred_brush.cpp
- defpass_composite.cpp
- deferred_utility.cpp
- defpass_gbuffer.cpp
- defpass_shadow.cpp
- GlobalLitGeneric.cpp
- IDeferredExt.cpp
- lighting_global.cpp
- lighting_pass_basic.cpp
- lighting_pass_volum.cpp
- lighting_volume.cpp
- lighting_world.cpp
- radiosity_blend.cpp
- radiosity_global.cpp
- radiosity_propagate.cpp
- volume_prepass.cpp
- volume_blend.cpp
- unlitgeneric_dx9.cpp
- vertexlitgeneric_dx9.cpp
- vertexlitgeneric_dx9_helper.cpp
- lightmappedgeneric_dx9.cpp
- lightmappedgeneric_dx9_helper.cpp
- lightmappedgeneric_dx9_deferred_helper.cpp
- phong_dx9_helper.cpp
- gbuffer_vs30.fxc
- gbuffer_ps30.fxc
- gbuffer_defshading_ps30.fxc
- shadowpass_vs30.fxc
- shadowpass_ps30.fxc
- composite_vs30.fxc
- composite_ps30.fxc
- defconstruct_vs30.fxc
- decalmodulate_vs20.fxc
- decalmodulate_ps2x.fxc
- lightingpass_global_ps30.fxc
- lightingpass_point_ps30.fxc
- lightingpass_spot_ps30.fxc
- screenspace_shading_ps30.fxc
- screenspace_combine_ps30.fxc
- volume_blend_ps30.fxc
- volume_prepass_vs30.fxc
- volume_prepass_ps30.fxc
- volumpass_point_ps30.fxc
- volumpass_spot_ps30.fxc
- radiosity_gen_global_ps30.fxc
- radiosity_gen_vs30.fxc
- radiosity_propagate_ps30.fxc
- radiosity_propagate_vs30.fxc
- radiosity_blend_ps30.fxc
- screenspace_vs20.fxc
- gaussianblur_6_ps30.fxc
- debug_shadow_ortho_ps30.fxc
- debug_lighting_ctrl_ps30.fxc
- debug_radiosity_grid_ps30.fxc
- debug_radiosity_grid_vs30.fxc
- globallitgeneric_ps30.fxc
- globallitgeneric_vs30.fxc
- phong_deferred_ps30.fxc
- lightmappedgeneric_deferred_vs30.fxc
- lightmappedgeneric_deferred_ps30.fxc
- vertexlit_and_unlit_generic_bump_deferred_ps30.fxc