Facepunch / garrysmod-issues

Garry's Mod issue tracker
141 stars 56 forks source link

surface.DrawLine rounds to integers in 3d2d context #5136

Closed TiberiumFusion closed 2 years ago

TiberiumFusion commented 2 years ago

Demonstration

gmod surface 3d2d rounding

Addendum

This would be far less of a problem if some render.DrawPoly or similar method for drawing basic 3d surfaces (not wireframes) existed. Being forced to use both surface and render in tandem, and thus having to transform verts from 3d2d to 3d and vice versa, in order to draw arbitrary polygons in 3d is annoying.

Rebuttal

But but but surface.DrawCircle!!!!1!11one!1!! This is a contrived example that uses a circle for demonstration. What if you need to draw an ellipse, or a letter, or a voronoi diagram?

Use a smaller 3d2d scale As a somewhat ugly workaround, sure, if you aren't already at the boundary of float precision with your transformed verts. But I'd rather not have a scale of 0.000001 and vertices that look like 100000000, 100000000, 100000000 just to draw a clean shape 100 units large, and I don't think you would either.

thegrb93 commented 2 years ago

all surface functions do that. that's intended behavior

TiberiumFusion commented 2 years ago

@thegrb93 Since you can't be assed to spend 20 seconds to read the issue in its entirety, let alone test your incorrect claim before posting misinformation, let me spell it out for you with some code. This seems to be a bad habit with you. surface_vertex_rounding_demo.zip

Actually read the issue description, run the test code for yourself, and observe the issue. It is obvious that not all surface functions treat vertices the same way, and that DrawPoly accepts non-integers while DrawLine always rounds. Now tell me again that "all surface functions do that".

thegrb93 commented 2 years ago

suck my balls nerd. I've reported it before and gmod devs didn't care. so goodluck

TiberiumFusion commented 2 years ago

@thegrb93 Can't suck what doesn't exist. Do you have a link to where you previously reported this issue? There may be useful information there, and I am curious as to how long Facepunch has been ignoring this issue in their trademark fashion.

robotboy655 commented 2 years ago

Should be fixed on Dev. Other things to consider for you: 1) https://wiki.facepunch.com/gmod/surface.DrawCircle 2) Decrease the scale of the 3d2d

thegrb93 commented 2 years ago

@TiberiumFusion https://github.com/Facepunch/garrysmod-issues/issues/3433

Cool beans @robotboy655