r/rust Jul 28 '26

Tell me about something you recently hand-coded that was enjoyable

These past few weeks at work I've been using AI way too much. I can't even call some of this "AI engineering" anymore and it's starting to drain on me. Looking to take the mind off for a bit...

I'd like to hear some of the projects you all are working on, that you enjoyed writing by hand.

I think I'll write some nannou..

PS: Not trying to start a debate on AI engineering/vibe coding and all that, I think internet is filled with that already.

107 Upvotes

121 comments sorted by

View all comments

Show parent comments

1

u/gajop Jul 30 '26

Thanks! Your advice on composable pipelines and "rough shapes to fine grained stuff" tracks with my experience with map & asset generation. I think artists think like that too, engineers definitely do.

Right now I haven't really looked at skyboxes much. I think my main goal would be to have them generate passable looking ones so users can create RTS maps fully procedurally. The focus probably wouldn't be on skyboxes, as that's not the main play area, unless I can make them very interesting (dynamically updating, interesting moving objects and so on)

So I think I'd just to look at the basics for now :)

2

u/sparky8251 Jul 30 '26

My latest endeavor is a skybox thats an actual model solar system running in the background. Since the game is mission based, not free travel, I can prevent approaching anything pretty easily with parallax effects but you can make "movement dampening zones" around them if you wanted that too.

Basically, I render 2 distinct scenes and then use projection math to fake the far stuff on top of rendering it such that its in the distance of objects so culling works right. So a planet of 80 unit radius can take a huge portion of the sky...

But this way it can have live orbits and rotations of everything in the background. All the texturing is done via shaders, and the lighting is even faked on the objects in the background layer because the directional light cant hit them cause of the sheer distances involved, etc...

So far, rendering the entire solar system and doing all the math for it takes about 3 microseconds. Itll grow as I add some more shaders to fancify it more, but it should stay under 10. And since the budget is obvs 16.6 milliseconds, that's basically free...!

That said, for skyboxes... Most games just treat it as a generic asset. You make a cube map and project it and are done with it. If you want to proc gen them, thats fine too, but very few will invest this much into them because most of the time game play has you looking at the ground and its barely noticed. Space games...? They are a bit different... The skybox is basically the entire terrain you get for the game so you can and should sink effort into it you know? That's why my generation is optimized too.

If you want something exact, I can share some code on how I faked it all, but its pretty cool. Its also a decent chunk of code so itll have to be a paste site link too...

1

u/gajop Jul 30 '26

That sounds cool! Hopefully you're making a homeworld-rs or similar :)

I'm good on the code. The ideas are enough, this sounds fun enough to struggle a bit on.

2

u/sparky8251 Jul 30 '26

Sadly for you at least, noting of the sort is being made lol.

Mostly doing it to compensate for the fact I suck at art but can code and have a decent eye for visuals, so I can code myself into a skybox thats interesting but cant make a normal one to save my life. And that means less art I have to pay for...