Monthly Archives: December 2014

a chellenge – hierarchical voronoi

Procedural content can be split in explicit and implicit. Implicit proceduralism is very powerful when it comes to managing complexity, for it allows to generate content without any significant memory footprint, or alternatively, without having to manage memory in clever ways. Perlin noise and regular Voronoi based methods are examples of such powerful methods. However, these methods tend to be local in nature, and they usually lack any global features of macrostructure. In the case of Voronoi in particular, generating implcit voronoi patterns is easy and well known in CG by using the virtual grid technique, such that no feature points need to be stored or sorted/organized in any map, making the evaluation time constant and the storage zero. However, this method only produces constant density of cells. And so, getting cells to clump in some areas while other parts of the space get wider cells has been unseen with implicit methods, as far as I know.

My colleague Philip from Bristol challenged me to think about the problem the other day. Five years ago we’d bounce such problem back and forth quite regularly. Those were really good days. I still miss it, so when he came to me with this issue of multiscale Voronoi, I jumped into it immediately. And despite nobody seemed to have worked on this before, the problem happened to have a not so complex solution. The puzzle was fun though, it took a good few hours to solve. The result was a Hierarchical Voronoi procedural pattern that is implicit. I can probably not underscore that quality enough.

As a test case for the technique, I made this image (of Rapunzel, as drawn by this German artist), where the cell are constructed by self splitting themselves into smaller cells on the fly at evaluation time – once more, there’s no feature points of acceleration structures or memory used at all.

As usual, the realtime code is online and available: https://www.shadertoy.com/view/Xll3zX.

that guy

if Vimeo was a person, it’d be that self important guy with thick glasses and weird hair and clothing that pretends to be deep and self aware who still doesn’t get why nobody likes him. i feel. it might be a broken impression.

the world was smaller

when i was a kid the world was smaller.

and “korea” was a very distant place. or rather, a concept (and hence the double quotes). “korea” was about as distant as “interest rate”, the “mitochondria” or “cleopatra”. as you can see, i’m using distance to express depth of knowledge. in my world of thoughts, that made sense, and it still does.

i only knew about these double quoted things because i saw them in the books (or the encyclopedia, my favorite book back then). they didn’t exist in any physical form in my world, and as concept they also didn’t exist in any intellectual form i could manipulate. they were simply objects i was told existed, somewhere in the vacuum beyond the boundaries of my world.

that world of mine was just a few kilometers wide. it contained my family, nature, some music, festivities, school, stars, shame, snow, the milky way, puzzles, the ocean, pride, cloth, food, fear, the beach, maths, weekends, tales, people, desires, proportions, batteries, and all of the dreams and fantasies that belonged to my reality. and despite my ability to operate with abstraction was powerful back then, just as it is today, the volume of things i could feed it with was reduced to what i could find in that little world of mine, which was a few kilometers wide, and what my imagination could produce, which was a few kilometers high.

that wasn’t that long ago, damn. i am still that kid i guess. it’s only that with age i’ve add layers of myselfness to who i am, and i suppose my internal world is not so small anymore, it must few a few hundred kilometer wide now.

i stop my stream of thoughts for a moment. i’m sitting at the bar of a restaurant, waiting for this korean woman that i am meeting. i think i’ve lost sense of time, but it’s okey, she’s not here yet. i look at the watch, then i take a zip of water, and look around me first, and then to myself. yeah, definitely the world is not that small anymore.

still shocked

i already suspected this people don’t like water, but today i got a pretty visual evidence of it. due to the lens in the camera, this picture doesn’t even capture all of the variety of drinks offered in this store. of which, only a couple of bottles at the very end where water.

i don’t get it, water tastes and feels so much better than any of those stuff. i fell i’ll never get it, perhaps one one needs to be risen here in order to understand it.

square quarters

Since (a+b)² = a² + 2ab + b², then ab = ( (a+b)² – a² – b² ) /2 = ( (a+b)² – (a-b)² – 2ab) )/2 = (a+b)²/4 – (a-b)²/4

Now, (a+b)²/4 – (a-b)²/4 seems to be like a difficult way to compute the product of a and b. Unless you have tables of square quarters computed in advanced, cause then all you need to do is three addition/subtractions. And this is pretty sweet, for example, if you are a Babilonian living 4000 years ago.

nested sines

Speaking of maths, the other night I started coding with the intention of doing a very short technical experiment. I wanted to see how derivatives would behave after nested distortion, so I started deforming a sphere with some sine waves. Soon I realized the shape of the object was far more interesting than the experiment itself, so I ended up improvising this mathematical image. As usual, these things happen when you less plan them.

Open code and maths, plus the realtime animation here: https://www.shadertoy.com/view/4ssSRX

just 2

n + n = n · n, are numbers 0 and 2
n · n = n ^ n, are numbers 1 and 2
n + n = n · n = n ^ n, is just 2 alone

After addition, multiplication and exponentiation, the next operation is “tetration”. And even then, n + n = n · n = n ^ n = n ^^ n only for 2