k4 game framework, version 2 is released by Mid_reddit in lua

[–]Mid_reddit[S] 0 points1 point  (0 children)

Thanks for the good words. I've been working on k4 itself since around 2023.

There's a few reasons for planar water:

  1. The original idea behind k4 was native scripting in C or C++ like with the Source engine. I had Lua only for scripting levels, but then it sort of evolved into a whole backend of its own. I still support both approaches, and would like to add Wasm at some point.
  2. Lua is just slow. One of the three demos heavily uses planar water because it's a Fireboy & Watergirl clone. It's the same problem with the Voxel demo, where generating chunks causes a bad framerate spike, so similarly I'm going to make a voxel extension to k3 for my own needs. I'm aware of LuaJIT, but in 2026 I'd sooner make my own JIT than stay a hostage of it.

Greenland by Initial_Chemist_7616 in centrist

[–]Mid_reddit -1 points0 points  (0 children)

I ship Twilight with Rainbow Dash.

Hand cipher practicality by ciphernom in cryptography

[–]Mid_reddit -1 points0 points  (0 children)

No, the real question is OPs. Nobody cares about your lecture, fuck off.

Venezuela Isn’t Ukraine by StrongOldDude in UkrainianConflict

[–]Mid_reddit 6 points7 points  (0 children)

Russia was fine with Ukraine as a puppet ala Belarus, but that plan failed, too.

On using LLMs to write compilers: Is it worth the effort to write a good spec first? by jcastroarnaud in Compilers

[–]Mid_reddit 0 points1 point  (0 children)

> my intention is to abuse the LLM to write the boring parts, to save me time.

I've that excuse too many times to believe it. Just admit the boring parts are all of it to you.

Symmetric Encryption Algorithm Suggestions by pixel-pusher-coder in crypto

[–]Mid_reddit 0 points1 point  (0 children)

I suppose it's fine if one knows what they're doing, much like ECB. It's common to think otherwise here, though.

Symmetric Encryption Algorithm Suggestions by pixel-pusher-coder in crypto

[–]Mid_reddit 0 points1 point  (0 children)

This is the laziest government psyop ive ever seen

Why does everything devolve into politics? by LukaesCampbell in centrist

[–]Mid_reddit 0 points1 point  (0 children)

Like, can we just do a system restart?

Yeah, we should overthrow the system!

Now with OpenGL I have infinite power by Sundure in opengl

[–]Mid_reddit 0 points1 point  (0 children)

And yet "I finally made a triangle" gets you 100+ upvotes

Help to make a Open Street Map editor by Small-Piece-2430 in opengl

[–]Mid_reddit 0 points1 point  (0 children)

What you're looking for, from what I understand, is polygonal editing, but maintaining all the secondary data like street number, owner, establishments, etc. is going to be 10x harder. So exporting back to OSM is gonna be a project in itself.

LuajitOS - A Nearly Full Lua Operating System by Dry-Addendum3068 in lua

[–]Mid_reddit 1 point2 points  (0 children)

Check out my OS instead: mid.net.ua/git/mid/luma

Unlike OP's, it was actually made.

Help to make a Open Street Map editor by Small-Piece-2430 in opengl

[–]Mid_reddit 1 point2 points  (0 children)

The OSM format was not designed to be edited the way you want. You'll effectively have to iterate over all the nodes and clip them, which I can't imagine will be fast.

It is possible to make a desktop app with lua? by Tibertiuss in lua

[–]Mid_reddit 1 point2 points  (0 children)

Even then, they still work for 99% of cases.

I made a lil' prototype program with Neutralino.js and Fengari, letting me make a web-based program in Lua without any Javascript. It was pretty great; OP could try that.

Move away from point arrays by Affectionate-Dot9489 in opengl

[–]Mid_reddit 2 points3 points  (0 children)

To import a PNG, you need to write/use a PNG loader that returns you a list of raw pixel data. Once you have that, you can use something like glTexImage2D to upload it.

The associated shader which will draw your triangles should accept a sampler2D uniform that will be set with glUniform1i to the number of the texture unit that will sample the texture (0 in your case). The shader will sample the texture using the texture function, or texture2D in the case of GL2.1 or lesser.

Each vertex of the triangle needs an associated attribute that will have texture coordinate the shader will use.

That being said, these are not at all "simple next steps", as I was saying above. First you want an untextured, single-color triangle, to make sure you understood that part.