Can we have a console command to reset rendering if we messed something? Probably been one of the longest standing bugs in gmod, hate having to restart gmod constantly for a simple typo.
You can restart the Level, dont have to restart Gmod.
I have been rejoining my server just make do with seeing if my changes work before having to restart gmod (and face the same issue) - this is rejoining the same map. Are you suggesting changing map fixes the issue? The issue persists after each rejoin in my case.
Is the Server/Gmod running on an Windows OS? If not you will havevto restart every time.
My test server running on my laptop is on Windows, and my production server is on Linux. Both have auto refresh - but this isn't an issue with the server, it's an issue with the client rendering. Haven't tested changing map, but pretty sure this problem REQUIRES a gmod restart to fix rendering.
Hmm like i said, never had to Restart Gmod myself even when with Rendering.
I don't think we have a common understanding of what the problem is.
try creating a 3d2d instance with an error in it. You'll soon see what I mean.
Yea i know what you mean.
I talked about rendering with cam2d3d .. Like i said i dont gave to restart the level most of the time. And never Gmod itself.
The only thing I know of that requires a full restart of gmod to reset is CreateMaterial and GetRenderTarget(Ex). Everything else - rendering hooks, entities, everything - will completely start from scratch once you rejoin or the server does a changelevel.
https://puu.sh/B35Jx/ff8b7759da.png
This has been a bug for as long as I remember, and it's always been a case of restarting gmod. This is from a fresh rejoin. This problem has occured on every pc I have ever used to play gmod in my several years of playing and coding. Today I just got fed up with it being an issue.
Could you post an Code Snippet and the Console Output?
The code I'm working with is rather large to summarise, and there is no console output indicating anything going wrong.
My main point, which should be fairly evident - is that these rendering bugs persist after rejoin - which shouldn't happen. If it were something to do with the code, then restarting gmod would have the same effect as simply rejoining.
Since no one else has this issue, there has to be something unique that that particular server does which doesn't get reset on rejoin (you said this happened on several computers). As I said, the only things I'm aware of are CreateMaterial and GetRenderTarget.
Another possibility is that one of your addons - maybe even a menu addon? - is triggering this issue. Have you seen other people experience this?
I too have had these issues when i accident screwed up something using 3d2d.
And yes, it does require a full restart of gmod on my end as well.
Any way to reliably recreate this?
I assume it has to do with using cam.Start3D2D without cam.End3D2D afterwards (e.g. because errors happened before getting the chance to do that). Any particular hook?
It is probably going to be something like this. I've really only had this when using an Entity's Draw hook. Chances are it is about cam.End3D2D no being called - but would be great to have a command that resets what it can. Once the game is in this state, it needs a restart.
I managed to trigger a similar-looking issue with the following console-run Lua in singleplayer:
lua_run_cl hook.Add("PreDrawOpaqueRenderables","a", function() hook.Remove("PreDrawOpaqueRenderables","a") cam.Start3D2D(Vector(), Angle(), 1) end)
It runs once, in PreDrawOpaqueRenderables (probably in the context of drawing the skybox or map, as that's the first thing drawn in the Render Order), starts a 3D2D context and never ends it. Results:
https://files.facepunch.com/forum/upload/767/6ff56c55-ed15-40d7-9bcb-77d609dfbdd5/gm_construct0023.jpg
https://files.facepunch.com/forum/upload/767/7da00a55-3249-43a2-920b-bdc9f727f080/gm_construct0024.jpg
But this did get fixed as soon as I changed level! Or disconnected and started a new singleplayer game.
Worth noting is that I'm on 64-bit Garry's Mod right now, that could make a difference.
You screw up the rendering stack by not ending cam.Start functions, not disabling clipping planes after enabling them, not disabling IgnoreZ after enabling etc the list goes on. It should fix itself after running the proper code without needing to reload the map, unless you screwed up big
This happened when an error occurred in the creation of a mesh.
https://i.imgur.com/cANqyD4.jpg
Neither level changes, nor full restarts fixed the render stack.
Sorry, you need to Log In to post a reply to this thread.