Guest User

gmod render poster reproduction

a guest
Apr 20th, 2016
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- save as garrysmod/lua/posterdebug.lua
  2. -- bind j "lua_openscript_cl posterdebug.lua"
  3. -- press j in-game to toggle the hook off and on
  4.  
  5. local hooks = hook.GetTable()
  6. if hooks and hooks.RenderScene and hooks.RenderScene.GAAHHHHHH then
  7.     hook.Remove("RenderScene", "GAAHHHHHH")
  8.     print("Hook REMOVED")
  9.     return
  10. end
  11.  
  12. print("Hook ADDED")
  13.  
  14. local tex_render = render.GetMoBlurTex0()
  15. local mat_copy = Material("pp/copy")
  16.  
  17. hook.Add("RenderScene", "GAAHHHHHH", function(origin, angles, fov)
  18.     render.PushRenderTarget(tex_render)
  19.         render.RenderView()
  20.     render.PopRenderTarget()
  21.  
  22.     mat_copy:SetTexture("$basetexture", tex_render)
  23.     render.SetMaterial(mat_copy)
  24.     render.DrawScreenQuad()
  25.  
  26.     return true
  27. end)
RAW Paste Data