SFML community forums
Bindings - other languages => DotNet => Topic started by: Dominator on November 14, 2009, 02:27:24 am
-
Hi!
I'm using the latest SFML2-SVN with C# and encountered a problem when I tried to draw diagonal lines with Shape.Line().
It won't show the line when the thickness is set to 1.0f.
When I set it to 2.0f it's shown, but - like expected - double the size.
I tried to find a value that resembles 1.0f thickness, but it varies with the position and angle, so there is no safe way to get the right thickness.
If I for example want to draw a line from the upper left to the lower right corner of a 200x50 px rectangle, the line will look alright starting from a value of 1.03077f.
(http://i34.tinypic.com/2n7i9p1.jpg)
-
Interesting... I'll look into this issue as soon as possible.
-
Any progress so far?
-
Yes. This is caused by the little piece of code that fixes rendering artifacts by rounding points coordinates. If you want a quick and dirty fix, I can tell you how to disable it.
I still haven't found a good and clean solution for this.
-
What kind of artifacts does it fix?
Is my program affected if I only use 2D stuff like Shape and String2D?
Do you think you can get this fixed in the near future?
Anyway, please tell me how to disable it.
-
What kind of artifacts does it fix?
A lot, actually :)
It fixes all the unwanted pixels that may appear when a texel is not exactly mapped to a single pixel of the window.
Is my program affected if I only use 2D stuff like Shape and String2D?
Probably not.
Do you think you can get this fixed in the near future?
I have no idea how, but anyway I have no choice, this bug must be fixed ;)
Anyway, please tell me how to disable it.
In SFML (C++) source code, comment the lines 232 / 233 / 234 / 235 of the file src/SFML/Graphics/RenderQueue.cpp. Then recompiler everything (SFML, CSFML, SFML.Net).
-
Thanks! I can't see any artifacts (yet :wink: ) in my program, so it seems to work fine for me.