/*---------------------------------------------------------
Register the convars that will control this effect
---------------------------------------------------------*/
local pp_stereoscopy
= CreateClientConVar( "pp_stereoscopy",
"0",
false,
false ) // On/Off
local pp_stereoscopy_size
= CreateClientConVar( "pp_stereoscopy_size",
"6",
false,
false )
/*---------------------------------------------------------
Can be called from engine or hooks using bloom.Draw
---------------------------------------------------------*/
local view = {}
view.y
= ScrH() / 2 - h
/ 2
view.w = w
view.h = h
view.angles = ViewAngles
// Left
view.x
= ScrW() / 2 - w -
10
view.origin
= ViewOrigin +
Right
// Right
view.origin
= ViewOrigin -
Right
end
/*---------------------------------------------------------
The function to draw the bloom (called from the hook)
---------------------------------------------------------*/
local function DrawInternal( ViewOrigin, ViewAngles )
if ( !pp_stereoscopy:
GetBool() ) then return end
// Return true to override drawing the scene
return true
end
hook.Add( "RenderScene",
"RenderStereoscopy", DrawInternal
)