Search found 15 matches
- Tue Aug 10, 2021 11:57 am
- Forum: Support and Development
- Topic: Boolean function for intersection between circular segment and circle
- Replies: 32
- Views: 42335
Re: Boolean function for intersection between circular segment and circle
I tried to simplify the handling of the corner cases while avoiding dealing with angles as much as possible. local abs, sin, cos, sqrt, min, max = math.abs, math.sin, math.cos, math.sqrt, math.min, math.max function intersect(cx, cy, cr, sx, sy, sr, a1, a2) cx, cy = (cx - sx) / sr, (cy - sy) / sr lo...
- Sat Mar 20, 2021 8:32 pm
- Forum: Support and Development
- Topic: OpenCL kernel or Shader to find in radius of X pixels around each pixels, highest and lowest greyscale value
- Replies: 2
- Views: 4081
Re: OpenCL kernel or Shader to find in radius of X pixels around each pixels, highest and lowest greyscale value
Yes, you could also do this using a shader but I don't know whether it'd be slower or faster (assuming you're using OpenCL on the GPU). The main problem with your approach is that the kernel is doing a lot or redundant work. It is possible to separate the circle into parts that can be computed separ...
- Tue Mar 09, 2021 8:17 pm
- Forum: Games and Creations
- Topic: Sea Traders
- Replies: 7
- Views: 8667
Re: Sea Traders
I like what I've seen of the game so far :) Nitpicks: After some very poor purchasing decisions and getting wrecked by pirates I started a new game and encountered this crash: $ love Sea\ Traders\ v2.love [ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1) [ALSOFT]...
- Sun Jun 21, 2020 6:22 pm
- Forum: Support and Development
- Topic: Jitter when creating images in love.load
- Replies: 13
- Views: 8287
Re: Jitter when creating images in love.load
The "real" problem with your code is that the movement of the ground and the pipes isn't precisely tied together. The nearest filter just makes it more visible. For updating of pipeX you use: pipeX = pipeX - GROUND_SCROLL_SPEED * dt if (pipeX < -PIPE_WIDTH) then pipeX = WIDTH end But pipeX...
- Fri Jun 05, 2020 1:57 pm
- Forum: Support and Development
- Topic: i need help making a trail for the ball in my game of pong
- Replies: 4
- Views: 11105
Re: i need help making a trail for the ball in my game of pong
You mean you'd like the ball to leave a trail on the screen? Assuming that the ball is white and the background is black, one simple way of doing that would be to override love.run with a modified version. Instead of calling love.graphics.clear(...) to clear the screen on each frame, you can tempora...
- Thu Apr 23, 2020 9:11 am
- Forum: Support and Development
- Topic: [Solved] Help with shaders in 11.3
- Replies: 3
- Views: 3127
Re: Help with shaders in 11.3
Looks like the name of _tex0_ changed. Adding the following line did the trick: uniform vec2 inputSize; uniform vec2 outputSize; uniform vec2 textureSize; #define _tex0_ MainTex // <- #define SCANLINES I just took a guess at what inputs the shader needs to get something to show up on the screen, so ...
- Sat Apr 18, 2020 2:17 pm
- Forum: Support and Development
- Topic: Mesh Instancing Inside a 3d Shader
- Replies: 3
- Views: 3654
Re: Mesh Instancing Inside a 3d Shader
I tried just writing a reply, but describing it in English seems harder to me than actually doing it, so instead I modified the example in the wiki to render in 3D and explained the changes with comments. -- I've changed the size of the triangle to 1/8 so I don't need -- to scale it down in the 3D s...
- Tue Jan 14, 2020 1:26 pm
- Forum: Support and Development
- Topic: Is there a simple way to make retro graphics render strictly within big-pixel-locations no matter what's in love.draw?
- Replies: 5
- Views: 4552
Re: Is there a simple way to make retro graphics render strictly within big-pixel-locations no matter what's in love.dra
You can do that by rendering to a small canvas and then drawing the canvas to the screen at a larger scale. Attached to this reply is an example that hopefully does what you want: https://love2d.org/imgmirrur/IrWZ14h.png If you want even rougher edges you can set mssa to zero in the code. While load...
- Tue Jan 07, 2020 2:58 am
- Forum: Support and Development
- Topic: Execution speed varies wildly (47x) between (but not during) runs
- Replies: 15
- Views: 10677
Re: Execution speed varies wildly (47x) between (but not during) runs
Thanks to all of you for reproducing the problem and having a look at it! ReFreezed : It seems to me that for my use case the multiple arguments/returns solution is not a good match. It doesn't solve the problem of efficiently allocating large data structures containing many vecs/matrices/whatever a...
- Sun Jan 05, 2020 11:29 pm
- Forum: Support and Development
- Topic: Execution speed varies wildly (47x) between (but not during) runs
- Replies: 15
- Views: 10677
Execution speed varies wildly (47x) between (but not during) runs
Hello, I'll start with some background info: driven by curiosity I've been working on a small FPS without external libraries. I've got a first prototype working (video on imgur) with all the linear algebra stuff written in plain lua. Although it's running fine on a desktop PC (~25% of one core) with...