garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

Rendertargets get cut off when drawn to HUD and game resolution is below RT dimensions

Open ZH-Hristov opened this issue 1 year ago • 1 comments

Bit of a crosspost from here:

https://github.com/thegrb93/StarfallEx/issues/1629

There's some example pics and a Starfall code example in there, but the code should be pretty similar for normal GLua.

Starfall RTs are limited to 1024x1024 for memory saving and reusage purposes, since we can't destroy RTs in GLua.

ZH-Hristov avatar May 31 '24 09:05 ZH-Hristov

After further testing, it seems this happens not only when RTs are drawn to the HUD.

ZH-Hristov avatar Jun 21 '24 17:06 ZH-Hristov

I couldn't be bothered to adapt your script to work in GMod, but the wiki page for render.PushRenderTarget has a clear indication to use cam.Start2D to draw to render targets larger than the screen, with an example.

robotboy655 avatar Jul 05 '24 13:07 robotboy655

I couldn't be bothered to adapt your script to work in GMod, but the wiki page for render.PushRenderTarget has a clear indication to use cam.Start2D to draw to render targets larger than the screen, with an example.

The thing is, Starfall's PushRenderTarget equivalent does do that, yet this still happens.

https://github.com/thegrb93/StarfallEx/blob/184648c3b208eb2f706b4b43899ef6589640f22a/lua/starfall/libs_cl/render.lua#L1182

ZH-Hristov avatar Jul 07 '24 10:07 ZH-Hristov

Provide Lua code to reproduce the issue, if you believe there's still an issue.

robotboy655 avatar Jul 07 '24 17:07 robotboy655