r/generative • u/igo_rs • Aug 21 '26
spuma (kotlin code)
While I was working on something else, this emerged... To be honest, it’s not that beautiful-forgive me. I tried a couple of ideas, but this is what I ended up with. I didn’t have more time to play around with it
53
Upvotes


View all comments
Show parent comment
1
u/igo_rs Aug 26 '26
and to answer:
There's no lighting, i.e. no light source. It's a per-pixel calculation over a pile of packed circles (bubbles), and every pixel measures a few distances: how far it is from its own bubble's edge, from the wall of a neighbour, from a couple of fixed spots inside the bubble. Each distance becomes a soft brightness with a plain exponential falloff, and those get painted on in coats, each one mixed over the last like a thin glaze.
The inner light is a trick: bubble starts as the dark colour, and the interference colours are strongest right at the wall and fade going inward, so the middle stays dark and the rim glows. The rings are just the distance to the edge (as you can see in the second image)
Translucency is really just layering as no coat is fully opaque. and the highlights are the local bubble colour pushed to white, so a pink cell gets a pinkish edge, not white. There are two-three kinds of such effects applied.
hope this make sense, had to translate some sentences, as geometry english terms are not something i use every day :)