I may be going insane.
This is as small as I could make my code to replicate the issue:
[lua]local tex_render = render.GetMoBlurTex0()
local mat_copy = Material("pp/copy")
hook.Add("RenderScene", "GAAHHHHHH", function(origin, angles, fov)
render.PushRenderTarget(tex_render)
render.RenderView()
render.PopRenderTarget()
mat_copy:SetTexture("$basetexture", tex_render)
render.SetMaterial(mat_copy)
render.DrawScreenQuad()
return true
end)[/lua]
[url=http://pastebin.com/f1AdtAXg](convenient reproduction code)[/url]
This code [i]works.[/i] If you want, you can replace render.RenderView() with render.Clear(255, 0, 0, 255) and see that the screen is red (pictured below). But while the hook is hooked, run 'poster 2' and the first render operation - the top-left corner - preserves the last frame. As if the render.DrawScreenQuad line doesn't run.
[t]https://i.gyazo.com/daa230cd73d27cb4a554e72e3a25485b.png[/t] ([url=https://gyazo.com/305a848c2d4f77640f39f1051687ca50]full size[/url])
[t]https://i.gyazo.com/c2362587a006fb376c18a9382aac8c90.png[/t] ([url=https://gyazo.com/1ff749da7d74aba151d71d23e644f2b4]full size[/url])
I am out of my wits.
The craziest thing is that [i]I swear[/i] this exact same code worked for me last week. And there wasn't even an update since then.
Does anyone have any idea how to force this to work?
[editline]20th April 2016[/editline]
This is insane.
[lua]local tex_render = render.GetMoBlurTex0()
local mat_copy = Material("pp/copy")
hook.Add("RenderScene", "GAAHHHHHH", function(origin, angles, fov)
render.PushRenderTarget(tex_render)
render.RenderView()
render.PopRenderTarget()
mat_copy:SetTexture("$basetexture", tex_render)
render.SetMaterial(mat_copy)
render.DrawScreenQuad()
render.DrawScreenQuad() -- ADDING THIS LINE FIXES THE PROBLEM
return true
end)[/lua]
is this a bug...?
Sorry, you need to Log In to post a reply to this thread.