So I am messing around with some 3D2D stuff but I have a problem that I have no clue how to solve it. Whenever a player is standing in front of a window or bush or something: The name above their head renders behind that thing for some reason.
Screenshot example:
https://files.facepunch.com/forum/upload/114140/b7acfcaf-e34b-40d1-8440-ba2e591a626a/Screenshot_91.png
https://files.facepunch.com/forum/upload/114140/73bd7ce4-2fdc-40d6-9a19-9c6491034afe/Screenshot_90.png
Notice that the trees leaves are drawn over the 3D2D text.
Could anyone point me in the right direction?
I don't know much about 3D2D but I can give you the theory side: everything that gets drawn is handled through render hooks that have some order to them. In this case the leaves are drawn in front of the text because they are handled in a render hook that comes AFTER the render hook in which the text is drawn. If you have control over which render hook to draw said text, choose different ones by trial and error until it's fixed
Sorry if this was unhelpful, that's all I know
That "Some reason" is because its kinda designed to be this way.
If you want to the text to draw over everything else, like a HUD, use the aptly named HUDPaint hook and cam.Start3D.
Since you're starting a new context it doesn't really matter where you draw it (as long as you draw it last), but if you want it to go away for screenshots GM/HUDPaintBackground is probably what you want. Otherwise use GM/PostDrawTranslucentRenderables.
(If none of that works, cam.IgnoreZ is a great hack)
You want to change the hook you're using to PostDrawTranslucentRenderables.
I am already using that hook, just wan't to figure out a way how to fix that issue above.
If the 3d2d is drawn over everything else, then it becomes a kind of wallhack. I am not creating that. ( You could just put a if statement to check if the player is looking at the player and then draw the thing but this is the thing I am trying not to do. )
Sorry, you need to Log In to post a reply to this thread.