Search found 280 matches

by RNavega
Sun Sep 13, 2020 12:27 pm
Forum: Libraries and Tools
Topic: Pixel art antialiasing shader
Replies: 5
Views: 13527

Re: Pixel art antialiasing shader

@zorg thanks for the suggestion, this was the closest test! For a single static image the result is identical to when using the shader with a filter size of 1.0 (one pixel). The problem is when you add moving things, and pretty much all games would have those. This is the exact same context (sprites...
by RNavega
Sat Sep 12, 2020 1:45 pm
Forum: Libraries and Tools
Topic: Pixel art antialiasing shader
Replies: 5
Views: 13527

Re: Pixel art antialiasing shader

Someone on LÖVE's Discord channel suggested some tests. If you draw your sprites scaled/rotated/subpixel-translated with 'linear' filtering onto a Canvas, and then draw that Canvas (scaled up or not) with 'nearest' filtering, the result you get looks blurry like with the standard 'linear' filter: ht...
by RNavega
Fri Sep 11, 2020 7:07 pm
Forum: Libraries and Tools
Topic: Pixel art antialiasing shader
Replies: 5
Views: 13527

Pixel art antialiasing shader

This is a pixel shader for use with modern pixel-art-style games that make use of smooth scrolling and scaling. It filters the edges of pixels, if needed, so they have an antialiased look. The size of the antialising is adjustable as a constant in the pixel shader in case you want it sharper or smoo...
by RNavega
Thu Sep 10, 2020 10:01 pm
Forum: General
Topic: export video from love2d
Replies: 7
Views: 29119

Re: export video from love2d

That looks dope AuahDark. I consider myself good at googling and couldn't find any Lua video encoding libraries, I wonder how I missed your ls2x. Very useful.
by RNavega
Mon Sep 07, 2020 1:11 pm
Forum: General
Topic: export video from love2d
Replies: 7
Views: 29119

Re: export video from love2d

Hi, I think the closest thing is the Canvas type, used for off-screen rendering. See these: - https://love2d.org/wiki/Canvas - https://love2d.org/wiki/Canvas:newImageData (a copy of the pixels in the canvas as an ImageData type) - https://love2d.org/wiki/ImageData:encode (saving that ImageData as a ...
by RNavega
Sat Sep 05, 2020 8:58 pm
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 14424

Re: how to get the compass direction between two points ?

Furthermore, I'm pretty sure that the big branching factor adds a performance penalty with respect to a pure atan2 + lookup implementation. See for example the benchmarks at https://love2d.org/forums/viewtopic.php?p=218409#p218409 Totally, if i had to pick a method I'd also go with ivan's atan2, it...
by RNavega
Sat Sep 05, 2020 12:42 pm
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 14424

Re: how to get the compass direction between two points ?

Hm, if it were some arbitrary float number then I would agree, but it's zero. I think it should be safe, even if either dx or dy are +0.0 or -0.0. If you remove that check, which you can do, then whenever the source and destination are at the same position the result will be whatever passes the test...
by RNavega
Sat Sep 05, 2020 11:37 am
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 14424

Re: how to get the compass direction between two points ?

For the challenge I did it a different way (comparing the tangents inside a quadrant to pick the "slice"/octant, then picking the quadrant based on the sign of dx and dy). I also changed the order of parameters in the direction function, LÖVE usually puts the position parameter first and t...
by RNavega
Sat Sep 05, 2020 8:06 am
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 47526

Re: Love CPU usage

I still don't see why the events processing time should not be included in the total measurement. I don't understand the confusion, timerStep() (alias for love.timer.step()) returns the time that's elapsed since the last call to it. So in that first code that I posted that we're talking about, when...
by RNavega
Thu Sep 03, 2020 10:43 am
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 47526

Re: Love CPU usage

The goal is getting a main loop that's as generous as possible to the CPU so you have low usage/no busy-spinning, it should do a game tick and then sleep to give all the remaining time back to the OS. The loop I posted I based on the first one in the deWiTTERS game loop article . To get my head arou...