Search found 273 matches

by RNavega
Sun May 26, 2024 2:36 pm
Forum: General
Topic: Please can someone help me write a shader/function
Replies: 4
Views: 119

Re: Please can someone help me write a shader/function

By the way, Delaunay is related to Voronoi, you can get it by connecting the centers of neighboring Voronoi cells.
Delaunay-triangulation-solid-lines-and-Voronoi-diagram-dashed-lines-for-20-points.png
Delaunay-triangulation-solid-lines-and-Voronoi-diagram-dashed-lines-for-20-points.png (90.55 KiB) Viewed 63 times
by RNavega
Sun May 26, 2024 2:10 pm
Forum: General
Topic: Please can someone help me write a shader/function
Replies: 4
Views: 119

Re: Please can someone help me write a shader/function

Hi. Try a 2D Delaunay triangulation. 1) Besides the 4 initial points of the image rectangle (its 4 corners), also add a bit of random points on the 4 edges of the rectangle, and a bit of points randomly inside the rectangle. All of these points then are your point cloud. 2) Triangulate the point clo...
by RNavega
Sat May 25, 2024 10:26 am
Forum: General
Topic: Help with my pool(billiards) game
Replies: 4
Views: 185

Re: Help with my pool(billiards) game

Get the angle between the mouse cursor and the ball with math.atan(mouseY - ballY, mouseX - ballX). The pool cue is 180 degrees (1 pi radians) in the other direction.
temp.png
temp.png (51.67 KiB) Viewed 92 times
by RNavega
Tue May 21, 2024 9:37 pm
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 23
Views: 1995

Re: How do you really tell if your game has a memory leak?

You can run it as fancy loop if you need proof that the construct will eventually crash your computer Regardless of what people want to call this, it does sound problematic as you have to explicitly call collectgarbage() before the program crashes, which isn't obvious if you expect the garbage coll...
by RNavega
Fri May 17, 2024 10:28 am
Forum: Support and Development
Topic: Garbage Collector and FFI
Replies: 17
Views: 1233

Re: Garbage Collector and FFI

Yeah, and that's my biggest question. How do I keep them alive , they get garbage collected as soon as I start the program. Since you already seem to be keeping references to the things being used (at least the obvious ones), I'd think that the problem might be happening from something not obvious....
by RNavega
Fri May 17, 2024 9:41 am
Forum: Support and Development
Topic: Garbage Collector and FFI
Replies: 17
Views: 1233

Re: Garbage Collector and FFI

I mean, I fill some of those buffers only one time while generating the map and then render them every frame. Other buffers are worked with constantly, they get new data every frame, and they still get garbage collected instantly. In your position, I'd check these things: That all FFI objects are k...
by RNavega
Fri May 17, 2024 7:20 am
Forum: Support and Development
Topic: Garbage Collector and FFI
Replies: 17
Views: 1233

Re: Garbage Collector and FFI

Come on, that's not the entire code. You have a 'ffi' name in there, so it's missing at least the require("ffi") call. Also, the indentation suggests this is within some block scope which does impact on the lifetime of objects. The only time I had a garbage collection issue like that (quit...
by RNavega
Thu May 16, 2024 5:56 am
Forum: Support and Development
Topic: whats the best way to make general colision detection?
Replies: 5
Views: 653

Re: whats the best way to make general colision detection?

@edu you're asking two different things: "how are collisions usually done in games", and "why is this thing in my game not working". The answer to the first is: usually you approximate the shape of complex objects with simpler geometrical primitives (like the boxes, circles/ellip...
by RNavega
Tue May 14, 2024 5:51 pm
Forum: Support and Development
Topic: Chroma Key Shader
Replies: 2
Views: 1052

Re: Chroma Key Shader

I was rethinking about this. There are simpler ways. If you sample the video pixel in a shader, and that video pixel color is an exact match to the chroma key color, then you should discard that pixel (or make it transparent). That should already give you a 98% ideal result. The remaining 2% is rega...
by RNavega
Sat May 11, 2024 7:10 am
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 1454

Re: [Help] Techniques for scaling

* To clarify on what this safety padding should be. There's no easier way than importing your PNG texture into Photopea , have a transparent background, then go to Filter > 3D > Texture Dilation and drag the slider until you're satisfied. Then File > Export As > PNG to download the result. No accoun...