I'm trying to some pixel based line art with rectangles and have been having trouble getting the lines to land exactly on pixels to avoid blurring. It appears that there is a default translation of (-0.5f, -0.5f). Resetting the graphics does not seem to set things back to the identity either.
Here is a quick way to see the problem (as least on my machine)
-- in love.load()
love.graphics.setMode( 1024, 768, false, true, 0 )
-- in love.draw()
-- love seems to have a default translation?
--love.graphics.translate( 0.5, 0.5 ) -- uncomment to fix the problem
love.graphics.setColor(0xFF, 0x00,0x00, 0xFF)
love.graphics.rectangle("line", 0, 0,1024,768)
love.graphics.setColor(0xFF, 0xFF,0xFF, 0xFF)
love.graphics.rectangle("line", 0, 0,100,100)
If you look carefully (screenshot and zoom in) you'll be able to see the filtering issues that this causes. Then if you uncomment the translation line above and run again the problem goes away.
I did search for issues related to translation and line drawing but failed to find what I was looking for.
Does anyone know if this is a bug or if this is by design?
Thanks,
Patrick
graphics.reset() not fully resetting translation?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: graphics.reset() not fully resetting translation?
Also, maybe this isn't a matrix problem but with the rectangle code. Adding the 0.5 translation makes my images and fonts look worse. 

Re: graphics.reset() not fully resetting translation?
Maybe I'm answering my own questions at this point but for "line" drawing modes, the coordinates would need to indicate the center of the pixel to land exactly and thus would be at 0.5,0.5 for the 0,0 pixel.
Never mind, feel free to lock this thread.
Patrick
Never mind, feel free to lock this thread.

Patrick
Who is online
Users browsing this forum: Bing [Bot] and 5 guests