Realike: the bendy engine

December 31, 2012 at 11:13 am | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , ,

Realike is a holistic simulation engine based upon the idea of atom that unifies what you see with what is detected (What You See Is What You Touch (WYSIWYT)) and let physic interactions emerge by themselves. It’s inspired by my previous work from 2004 Pentium IV 3000MHz II: fabric.

The nominal way of making 3D games was and is being explored thoroughly by most developers, that is: everything in the game is an empty triangle shell controllable through predefined animations. But (and this is a big but) the interactions are performed between invisible bounding volumes. Also if you want something to be breakable you must program it specifically. There’s nothing wrong with this traditional way, several of my all time favourite games fall under this category. But there are another possibilities.

Here is mine: every part of every interactive object in the game behaves as it should by itself. Just put out there your avatar or any interactive part of the scene and attach to it some forces applied to specific parts (= muscles) and you are ready to go. All collision detection will be performed over what you see on screen: What You See Is What You Touch (WYSIWYT). Fracture patterns will appear spontaneously whenever enough stress emerges on some part of the system.

One way to do this is just plagiarism of the way things are done in the real world: everything must be composed of (and exclusively of) atoms. Each atom could have position, size, mass, softness, interactions with other atoms, orientation…

Arising problem: the amount of atoms required to construct anything playable is going to be huge. Very careful design is going to be needed to reduce memory usage. And even more care should be put CPU wise. It could be challenging to animate at 60 fps many thousands of interacting dynamic atoms. Let’s also allow for static atoms used to create non changing parts of the game. Realike has been designed to address this issue. Some of its advantages are:

  • Varied material properties arise by themselves from internal specific atom structure (just as in chemical compounds), examples are:
    • rubbery materials
    • rigid materials
    • combination of rubbery and rigid along different axis
    • fragile (easily breakable)
    • unbreakable
    • fabric
    • malleable
    • fluid
  • No need for separate handling of bounding volumes for collision detection and visualization, this just happens by itself whenever something is constructed on the engine.
  • New exotic types of avatars are possible, for example real bipeds/quadrupeds. Watch the video for another example of a wrinkled thick-fabric like ball.
  • The difficult to rate advantage of an exciting new feeling. Hard to describe how enticing is to control an avatar inside an all atom world. You’ll have to trust me on this one until the game ‘Fathomed dodecahedron’ is released.
  • On the game editor front whole new approaches are possible all stemming from the fact you are now dealing with real filled objects with internal structure instead of empty shells.
  • Potentially everything can bend and/or break without any extra effort, it will just happen under the right stress.
  • If individual atom behaviour is well programmed then 2 natural physic traits will emerge by themselves without having expressly been coded: precession on rotating bodies and angular momentum.
  • There’s an oportunity here to innovate also at visual level. How are you going to represent the particles? realtime blobs? individual polygon spheres? using the atoms as the skeleton of an empty traditional triangle shell? are you going to raytrace them? billboarding perhaps? …

Here is gameplay capture of ‘Fathomed dodecahedron’, it runs at 150 fps on my PC:

'Fathomed dodecahedron'

‘Fathomed dodecahedron’

Colorado: interactive raytraced unlimited geometry

September 8, 2011 at 1:21 pm | Posted in Computer path | 2 Comments
Tags: , , , , , , , , , , , , , , , , , , , , ,

Mathematical operation sequences had been described for a ray to be realtime checked against all sort of geometries, basic (spheres, polyhedron, cylinders, torus…) and complex (clouds, classical fractals, trees…). The use of procedurally generated recursively inscribed bounding volumes offers a great creative canvas to improve along this line. The following is a realtime raytraced demo of a mountain landscape composed of slightly more than 17 trillion truncated triangular prisms (specifically 17.592.186.044.416). Also, truncated irregular triangular prisms are used as bounding volumes. There’s currently no LOD mechanism in place, every geometry is considered each frame. The 3D procedural texture is combination of 2D and 1D fractal turbulence splines mapped to a suitable color palette and has no LOD control. The demo runs on Raydiant, a general purpose light tracer not particularly optimized for real time. The default Colorado demo quality is preview and you can take high quality global illumination snapshots at any time that, depending on resolution, can last anything from 5 minutes to several hours (so start trying it at low resolution). Camera is controlled with the keyboard. This binary executable is for Linux and uses a Qt 4.6.2 GUI. Because those 17 trillion prisms exist as a potentiality defined by an algorithm they use no RAM. That’s a good thing because to store all prisms around 1 petabyte of RAM would be required. Colorado runs entirely on CPU, so you are strongly advised to execute it on a powerful multicore processor with 4 or more kernels. Raydiant performance grows linearly with kernel count. The binary has been tested on Ubuntu 10.04. The GUI provides you with help about the camera movement and means to change resolution. As the GUI is still at alpha stage mess with it at your own risk. More info about Raydiant is available at previous posts at this blog and at ompf. To get personalized renders from the engine this online service is available. Note that Colorado is different from what Euclideon is doing. Colorado is a raytracer and could have used *any* combination of geometry types: spheres, cylinders, torus, triangles, polyhedrons, polygons, bit matrix, washers, quadrics, points…
I found it difficult to grasp the meaning of elevated quantities like 17 trillion, to help me see what it amounts to this zooming sequence with a factor of approximately x4 million has been developed:

This slideshow requires JavaScript.

Download Colorado here, execute and please mind this instructions. How to select the antialiassing level. How to make global illumination snapshots.

Should circumstances allow it (meaning time is available) I intend to release a very simple concept game taking place on a large scenario, may be with real time completely dynamic global illumination over unlimited light sources.

Golden slabs, glitter and silhouettes

August 18, 2011 at 7:41 pm | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , , ,

These mosaics have been made using some filter trickery, isosurfaces, height fields, procedural 3D manipulation and lastly rendered with the Raydiant engine. Try it with your own photos at

Cute mosaic grows

April 20, 2011 at 5:01 pm | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , , ,

Thank you all for the support. Cute mosaic is getting popular and it seems many people want to get creative making mosaics from their photos. We have several interesting suggestions to improve the web (like making mosaics out of buttons, integration with PayPal, more materials…) that are being implemented right now. In the mean time here are some articles about the web and 3D engine:

Make a 3D rendered mosaic and win an iPod

March 26, 2011 at 10:39 am | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , , ,

At we have a brand new bunch of mosaic types, better and prettier than the previous ones. To celebrate we are making a contest. So if you are creative just go to, make a mosaic for free, upload it to facebook and wait for the people to vote. If you win an iPod will be yours!. Here are some of the new mosaics:

Mosaics mosaics mosaics

February 21, 2011 at 5:36 pm | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , , , ,

After some fine tuning, the mosaics produced by the Raydiant engine at are now showing for what they are: full global illumination 3D renders. Try any of this images at full resolution and see for yourself. And remember to do it with your photos for free at Also there is a new improved web interface.

Cute mosaic for you

January 29, 2011 at 5:55 pm | Posted in Computer path | 1 Comment
Tags: , , , , , , , , , , , , , , , , , ,

After some time at last a public server is ready to attend petitions for personalized mosaics rendered with Raydiant engine. There are almost 300 different configurations to choose from. The resulting mosaic can have up to 24 megapixels. No need to register, just configure your mosaic (the finnish method ‘Realistic’ is a full-fledge-no-tricks global illumination render of the composed mosaic), upload your photo and specify the mail where you want to receive the finished mosaic. Your feedback is most welcome. The web in question is Let me know if you find it fun!


September 26, 2010 at 5:02 pm | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , ,

Next Thursday begins matArte exhibit. It is hosted by ‘Cafe de la prensa’ at Seville, c/Betis 8. Features 13 synthetic images obtained through maths and patience. Below is the official poster, also rendered with the Raydiant engine. I’ll be there October the second from 6:00 PM. It’s exciting to have this opportunity to share visual maths though computer power. Perhaps those who know numbers are beautiful will enjoy it and those who still don’t could shift their belief.

How to create 3D True Type text

September 11, 2010 at 9:36 pm | Posted in Computer path | Leave a comment
Tags: , , , , , , , , , , , , , , , ,

I use Raydiant mainly as a procedural builder & renderer so having the ability to write 3D true types makes things more spicy. Allowing for easily (meaning procedurally) introducing all kind of sings and messages. I though it was going to be a piece of cake. Sure I can take a TTF and build a 3D volume accordingly, it will take 2 or 3 days.

As it became clear a week later it was going to be a little more trouble than I previewed, and also a lot more fun!. If you want to also add this functionality to some software this is what I did:

  • First your have to use some kind of API to get the outlines and holes the TTFs are made off. Depending on your SO and your lib of choice your will receive different kinds of data. I will suppose in this example that you can get a list of poly lines (lets call it PL) for any text string you want to draw. These polygons can be convex and also they can mean outlines or holes. As I learned the hard way these polys can also mutually intersect when 2 characters are next to each other and have unusual shapes (like hand writing fonts for example). The text is supposed to be aligned with the front plane at building time. A left-handed reference system will be used (positive Y goes upward, positive X goes to the right and positive Z goes ahead.
  • Create text sides: for each PL poly line segment build a square polygon having that segment as a side and as opposite side the same segment a little further away (increased Z). The Z increment defines the thickness of the final 3D text. Decompose each square into 2 triangles and we have the sides triangle list.
  • Now the thing to do is characterized every PL poly line so you can later build a 3D volume from them. First some definitions:
    • outline:
      • polygon with every vertex outside every other polygon
      • or polygon with every vertex immediately inside a hole polygon (there isn’t any polygon between it and the hole polygon)
      • or the polygon with more vertex not inside any polygon.
    • hole: polygon with every vertex immediately inside an outline.
    • a polygon A is considered to be immediately inside another B if and only if A has every vertex inside B and it does not exist a polygon C that contains A and is contained by B.
  • Assumption: the polygons intersect each other only slightly (actually this is a very bad math definition, but it works for me).
  • Algorithm:
    • 1. Find the mutual inclusion relation between every 2 PL poly lines.
    • 2. For each poly A which is not included by any other:
      • 2.a. Find all PL poly lines B[…] immediately inside A.
      • 2.b. Triangulate A as an outline with holes = B[…], accumulate triangles into front face and back face triangle list. The only difference between these 2 lists is a Z increment equal to the desired text thickness.
      • 2.c. Delete A and B […] from the list of polys and update inclusion of the rest of the polys.
  • How to triangulate a polygon with holes: this a well covered aspect on computational literature. The one that finally did the trick for me is an horizontal decomposition as described by Seidel (1991) extended to handle holes.
  • After all the effort at last you have 3 lists (sides list, front face list and back face list) defining 3D polyhedrons confined by triangles. This should be very easy to draw using any 3D API.

First picture is a example of what you get from a TTF API. Spheres mark the first vertex of each poly line (at the back a disastrous fill attempt shows why is necessary to triangulate). Then some wire-frame front face triangulations made with the described procedure, some 3D wire frames and some HQ renders from Raydiant engine:

The king of the potato people does let me

August 24, 2010 at 6:14 pm | Posted in Computer path | 1 Comment
Tags: , , , , , , , , , , , , , , ,

Firstly, this picture is an evolution of ‘The king of the potato people won’t let me’ (which you can see in the ‘Art’ tab of this blog). This new version has been rendered using the new Raydiant engine. It has much better quality (36 megapixel) so it can be printed at large sizes with high fidelity. This also allows for the potato people to be seen in better detail. And this is the kind of image that needs to be seen on big formats to be enjoyed. Has plenty of mysterious little ester eggs buried all along its green maze. The procedural generation of this image has led to the debugging of several pretty nasty and hard to find bugs on Raydiant, which is now more stable and also appreciably faster than before. May be I’ll post a real time interactive exploration demo for Linux (which is already working well in Raydiant). This picture has extended life time once printed, you can easily spend hours visually exploring its extremely detailed maze. Here are some zooms:

Next Page »

Blog at
Entries and comments feeds.