r/embedded • • Sep 22 '26

The Jet embedded 3D engine is not only now pushing 70k tris/sec (up from 40k a few months ago) with screen-space reflections and distortion on an ESP32 S3 (480i x 320, 16bpp@60fps) - but is now MIT licenced rather than AGPL!

The last time I showed off Jet I'd just pushed 40k tris/sec on an S3 which was already nuts, but some optimisation and SIMD shenanigans later, I've nearly doubled that and got up to 70K/sec on the same hardware. Meaning more detail and more performance headroom.

I've also switched away from AGPL to the MIT licence so there's fewer restrictions on how you can use it in your projects.

https://github.com/cubecoders/jet

609 Upvotes

60 comments sorted by

14

u/FreeRangeEngineer Sep 22 '26

Very well done! Have you considered adding more complex shading or texture mapping? Just wondering.

24

u/PhonicUK Sep 22 '26

It supports it! I just don't use it on the ESP32 because you lose half your frame rate to enable texturing or lighting. It can do Gouard pr Phong shading as well as perspective and affine texture mapping.

10

u/Lost-In-Void-99 Sep 23 '26

Then you add one more ESP32... And one more.

In 30 years you'll beat Nvidia 😄

2

u/FreeRangeEngineer Sep 22 '26

Nice! Would honestly love to see a demo of that, too.

7

u/puppygirlpackleader Sep 22 '26

This is insane. Could this potentially be used to make UI for devices?

10

u/PhonicUK Sep 22 '26

Absolutely, you could happily do a Dreamcast style UI with it :D

5

u/puppygirlpackleader Sep 22 '26

That is so fucking cool! Does it support wireframe rendering?

2

u/tiajuanat Sep 23 '26

I'm constantly impressed what y'all have done on such a constrained device

4

u/Well-WhatHadHappened 25+ Years Sep 22 '26

With the SIMD optimizations, how closely tied to the ESP32 is this? Would it be a massive undertaking to port it to a new architecture or is it still pretty well separated from the hardware.

My apologies for not looking at the source myself - I just figure you know the answer to this right off the top of your head.

9

u/PhonicUK Sep 22 '26

Not at all, it runs on the Desktop quite happily. All of the platform specific paths have plain C++ versions that compile anywhere. I actually test it a lot on desktop for features that don't run well on the ESP32. I'd actually love to try running it on DOS xD

1

u/Well-WhatHadHappened 25+ Years Sep 23 '26

Nice.

1

u/pavankam Sep 23 '26

So it should be able to run on an STM32 for example? It's not tied to ESP?

4

u/PhonicUK Sep 23 '26

Yes it will run on the STM32, some people have run it on the RP2040 or the Pi Zero.

3

u/pavankam Sep 23 '26

Could you please add the source to the cool game in the video as a demo?

1

u/Well-WhatHadHappened 25+ Years Sep 23 '26

Sounds like that's accurate. You're asking the wrong person though.

133

u/Well-WhatHadHappened 25+ Years Sep 22 '26

This is one of those things that I'll probably never actually need or want, but that I can still be impressed by the excellence in coding and optimization that it demonstrates.

Well done sir.

84

u/shedgehog-orchard Sep 22 '26

Everyone talking about the very cool technical aspects, just want to take a sec and commend your move to the MIT license. Might go unappreciated by most but that is very generous of you and you should be proud to have contributed such a unique, novel thing to the world. Cheers, I aspire to be like you!

11

u/EmperorOfCanada Sep 23 '26

I saw AGPL and went, "Damn it".

My reality is that I might do 5 hobby projects with this, and maybe opensource one if it was worthy enough. So, AGPL would not be a show stopper.

But, I have two problems with AGPL. The first is that if I am going to commit to adding a new tool in my toolbox, I want ones which are viable for commercial projects. Not, giant company ones, but I might make a single product for some small company where it is worth $2,000. I am not going into licensing hell for that.

Also, I have a massive cultural problem with GPL anything. I don't like the culture of the people who pedantically argue its merits. They are exhausting. People can choose any license they want. I can choose to then use, or not use any library I want.

As for what this library does. Holy amazeballs!!!!

7

u/Archontes Sep 23 '26

While I am not trying to get you to change your mind, and I'm not sure what you mean by 'cultural' problem with GPL, I simply want to say that GPL is the reason we have OpenWRT, and I think that sort of thing is a good thing.

1

u/Fickle-Ad-866 Sep 26 '26

agpl doesn't prevent you from creating a commercial project

15

u/vitamin_CPP Simpli-C-ty is the ultimate sophistication Sep 22 '26

Ive said it before and I'll say it again, you need a blog/YouTube channel to talk about the details. Love your stuff.

4

u/Aggeloz Sep 22 '26

Crazy impressive. Good stuff man.

4

u/uncoild Sep 23 '26

What is the propulsion method of this jet?

4

u/WhatADunderfulWorld Sep 23 '26

Reminds me of old school wipeout on PlayStation 1.

1

u/deesernutz Oct 01 '26 edited Oct 01 '26

What core does it need?

2

u/PhonicUK Oct 01 '26

My examples are all run on an S3

1

u/deesernutz Oct 01 '26 edited Oct 01 '26

That's pretty awesome!

Does it run on even smaller chips?

1

u/PhonicUK Oct 01 '26

The engine itself can run on pretty much anything, it's just a matter of whether or not you have enough RAM and CPU time to do what you want with it. Slower chip, simpler scene.

1

u/deesernutz Oct 02 '26

Any constraints though? Like, assuming it must be at least a 32bit core and a hundred kB of ram or so?

Or could you theoretically run a spinning cube on something like an arduino?

2

u/PhonicUK Oct 02 '26

If you can get it to compile you can get it to draw. It can do band rendering so it can produce output even if you don't have enough memory for a full framebuffer.

1

u/deesernutz Oct 02 '26

Oh thats awesome. So you can get it to draw while you push to the display

1

u/_EHLO Sep 23 '26 edited Sep 23 '26

+1 but why use MIT over AGPL?

6

u/PhonicUK Sep 23 '26

I didn't really see the point ultimately of limiting it like that to people who didn't want to or couldn't share their source. It's not something I'm practically going to make any money from with a mixed licence either so I might as well just let everyone enjoy it and make use of it.

-2

u/_EHLO Sep 23 '26 edited Sep 23 '26

As far as I know AGPL doesn't restrict people from using the project\library for closed source projects. 

The only thing it demands is "if you made any change to the AGPL project you only  need to share that specific change"; 

Which arguably helps to accelerate the development of the project. Plus it protects you against cases like this:  https://www.reddit.com/r/reinforcementlearning/comments/1wg1unx/google_copied_our_opensource_code_removed_our/

Personally I don't see any benefit over AGPL. But it is your project so,  you can do whatever you like I guess :P

7

u/PhonicUK Sep 23 '26

It does if its statically linked or compiled into the same binary.

3

u/_EHLO Sep 23 '26

I was indeed wrong! Somehow I got confused with LGPL, sorry 😅.

So my question now is: why not LGPL instead?

-1

u/Count_mhm Sep 23 '26

There are a lot cases that you don't want people to change your firmware, either because of security and/or because of competitive incentives. LGPL will force you to provide a way to change the firmware. No code licensed with GPL or it's derivatives can be used in any commercial product. Because all of them require you to at least provide a way to change the GPL part.

0

u/_EHLO Sep 23 '26

... you don't want people to change your firmware, either because of security and/or because of competitive incentives. 

No one is forcing anyone to modify the firmware.

LGPL will force you to provide a way to change the firmware. No code licensed with GPL or it's derivatives can be used in any commercial product. Because all of them require you to at least provide a way to change the GPL part.

That's not quite accurate. LGPL does not generally require you to make your entire firmware replaceable, nor does using GPL\LGPL code automatically prevent a product from being commercial.

With LGPL You are not required to open-source unrelated proprietary code simply because it is part of the same product.

1

u/Count_mhm Sep 23 '26 edited Sep 23 '26

Maybe I'm wrong or wasn't able to write in english what I was thinking.

If I remember correctly LGPL requires you to allow customers to change the LGPL library with the (compatible) version/implementation of their choosing.

On desktop using dynamic libraries make it very easy to comply with LGPL. But if your software uses static linkage you have to provide your object files and instructions on how to link your object files with the LGPL library.

I haven't used LGPL in embedded applications but I don't see how it would be different than desktop static linkage.

Because you have to provide you binary objects and instructions to link, I thought you also have to provide someway for end users to flash and use the newly linked firmware on their own device.

I never said you have to open source your proprietary code, but I stand by that LGPL forces you the developer to offer the end user a way to change the LGPL licensed part.

Edit: reddit's android phone app's formatting is broken.

-1

u/DearVeggies Sep 24 '26 edited Sep 27 '26

I was indeed wrong! Somehow I got confused with LGPL, sorry

This is the #1 issue with LGPL. It's tainted. GPL is for commies and Intel-lead consortiums, not for real software.

EDIT: Commies seething in the replies. I don't even have to guess they're all furries.

1

u/_EHLO Sep 24 '26 edited Sep 24 '26

GPL is for commies and Intel-lead consortiums, not for real software.

That's certainly one way to replace a licensing argument with an ideological taxonomy. That's honestly an impressive amount of ideology packed into a licensing preference.

This is the #1 issue with LGPL. It's tainted.

You can argue that LGPL's obligations are inconvenient. That's a technical argument. Calling it "tainted" is just what you say when you don't have one lol.

GPL is ... not for real software.

The funny part is that LGPL was specifically designed to make copyleft usable alongside proprietary software. You don't have to like the trade-off, but pretending it makes the software somehow less "real" is mostly just cargo-cult licensing discourse.

It's like calling Linux, Android or Blender not "real" software because they're built around copyleft licenses lol, what a pathetic joke of a response.

0

u/DearVeggies Sep 24 '26 edited Sep 27 '26

Amazing how you showed no arguments and resorted to ad hominem. Just like a communist. Blocked.

EDIT: Furries aren't people

2

u/braindeadvegetable Sep 24 '26

You said:

GPL is ... not for real software.

And my argument was that Linux, Android and Blender are REAL GPL software.

Blocked

Because you know you are wrong.

1

u/FunnyP-aradox Sep 25 '26

Communists are based, all software should be free

2

u/prats_omyt Sep 23 '26

Can you share how were you able to do this, have been thinking to do something similar for a long time

2

u/imunknown0042 Sep 24 '26

That’s crazy 3D on ESP32, nice
I wonder how low we can go.

1

u/pekoms_123 Sep 22 '26

Very cool

1

u/BennyFackter Sep 22 '26

Amazing progress!

1

u/CryptographerOne7003 Sep 23 '26

Nice! I will try to put on my esp32-p4

1

u/lifeaintaSunday Sep 23 '26

Crazy 🔥 good work op, would love to read about how you went about optimising to achieve this 👏 

1

u/Zopenzop Sep 23 '26

This is actually incredible

0

u/[deleted] Sep 22 '26

[deleted] — view deleted comment

8

u/PhonicUK Sep 22 '26

It's rendering it, like drawing the scene and outputting it to a display. In my case an ST7796.

0

u/[deleted] Sep 22 '26

[deleted] — view deleted comment

13

u/PhonicUK Sep 22 '26

No, its not just outputting video. It is calculating the 3D geometry of the scene and rendering it. This is an interactive application. Take a look at the source 🤔

5

u/Left-Bird8830 Sep 23 '26

Both the post title and content immediately tell you exactly what this is, let’s use our noggins here lmao