Creating procedural textures gives many people strange feelings. At big companies it's easier to ask a designer to draw a texture than to write a generator that creates one. But if you're making a game, procedural stages or models that run in a browser, such textures are a problem for you. The main issue is their size: compressing textures drawn by a designer without losing quality is very hard. There aren't many formats that can boast strong compression; probably the only leader right now is the BPG format by Fabrice Bellard. Let's try creating procedural SciFi textures using the “Voronoi diagram” method.
Creating procedural textures gives many people strange feelings. At big companies it's easier to ask a designer to draw a texture than to write a generator that creates one.
But if you're making a game, procedural stages or models that run in a browser, such textures are a problem for you. The main issue is their size: compressing textures drawn by a designer without losing quality is very hard. There aren't many formats that can boast strong compression; probably the only leader right now is the BPG format by Fabrice Bellard.
Let's try creating procedural SciFi textures using the “Voronoi diagram” method.
At first glance it may seem strange that this method can be applied to such a task at all. But let's not jump to conclusions. Let's try a modification called “Manhattan”.
In its usual form we used:
function getValue(dx,dy) { return sqrt(dx*dx + dy*dy);}
“Manhattan” looks like this:
function getValue(dx,dy) { return abs(dx) + abs(dy);}
A really simple change, but the result is already completely different:
This is already the very foundation for our texture generator.
Of course, looking at the picture a couple of ideas come to mind right away:
- paint it in more natural colors;
- give it volume;
- add small details;
- enjoy the result.
But as soon as we try to implement them, a rather sad result awaits us:
Since our formula is abs(dx) + abs(dy), we naturally get this specific picture.
So what should we do, you ask?
It's simple: modify the method to get an acceptable result.
To do that we need to get rid of the abundance of pyramids and create volume relative to the contours, and also add axial symmetry around a vertical line.
We've got an acceptable result already; now we need to increase the detail. We could of course do it individually for separate blocks, but for simplicity let's do all blocks at once.
Let's try a regular sin(dv), add embossing too, and look at the result once more.
To create the embossing effect we'll use very simple code:
for(var i = 0; i < data.length; i++) { if ( i % 4 === 3 ) continue; data[i] = 127 + 2*data[i] - data[i + 4] - data[i + w*4];}
Our result:
And now let's look at them on a 3D object to evaluate the result:
The result turned out quite decent: generating 512×512 procedural SciFi textures takes no more than 250 ms. Textures like these are no longer just noise and can have real applications. I hope to hear positive feedback. If you have questions or suggestions, I'll be glad to answer them.
View the demo
In October 2026 the invspace.com site got a new look. The link to the project used to take you straight into the game: click, and you were already in space.
Every year children in many countries eagerly hunt for chocolate eggs hidden by the Easter bunny. But today, as a fox, we're starting an egg hunt of our own.
In the article “Procedural SciFi Texture Generation,” I showed how a Voronoi diagram works on a plane and turns into a texture. Here is the next step: the same idea, but in volume.