![]() |
|
rendertarget issue when drawing text before polys / lines - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: rendertarget issue when drawing text before polys / lines (/thread-3658.html) |
rendertarget issue when drawing text before polys / lines - The17thDoctor - 11-06-2021 This one was pretty hard to nail down quite precisely but I found out that when creating fonts and then drawing first a text then polygons, the polygons in a rendertarget, they would not render. I also noticed artifacts on lines. When trying to create a line with extreme width, I found out that the line was actually textured like text. Here is a piece of code illustrating what I found out :
I also noticed that the post editor would not support TABs as indentation inside code. RE: rendertarget issue when drawing text before polys / lines - Person8880 - 11-06-2021 You need to reset the texture before rendering a polygon. It's trying to use the last set texture which internally will be the texture used for the text rendering.
Also as a side note, drawToTexture() doesn't need to be in a render hook. It's an asynchronous operation that renders separately (hence the function argument). |