Moar Cracks !

Hi there ! Last summer, while I was visiting the Urchin crew during my summer trip, I’ve spent a few days working on Tube in the nerdodrome. With Bassam, we had a discussion about cracks generation for the timelapse sequence. The environment for Wires for Empathy is mainly composed of concrete and we thought it […]

Hi there !

Last summer, while I was visiting the Urchin crew during my summer trip, I’ve spent a few days working on Tube in the nerdodrome. With Bassam, we had a discussion about cracks generation for the timelapse sequence. The environment for Wires for Empathy is mainly composed of concrete and we thought it would be kind of cool to have some nice cracks growing on the walls. Generating cracks is not that hard, we can do procedurally, with some great results. This tutorial explains how to do it fairly simply.

However, animating the cracks is a little bit harder and we cannot rely on the procedural method any more. We searched for examples and papers of people who already worked on this problem and found some great material. Unfortunately, most of the papers we found where based on heavy research and would include some serious C/C++ coding in order to have these tools inside Blender.

The python approach

Our first idea was to write an OSL shader that could generate cracks with some growing parameters that artists could use to control the speed and shapes of the cracks. Moreover, our rendering pipeline is entirely CPU based so using some OSL would be a problem. I’m sure it is doable in OSL, but I don’t know this language at all and even though I’m willing to learn this shading language, I would have spent a lot of time of time learning it, without being sure that I could achieve the result I wanted.

So I chose to use Python and to create a script that would manipulate Bezier curves to generate cracks in a procedural fashion. The generation algorithm is fairly simple and a based on a “branch” approach. Complex cracks can be splited into small simple “branch” that can be easily generated and manipulated. To do so, we have a very basic recursive algorithm that create a branch a determine the position of its children on it. We then repeat the branch generation on the children and determine its ow children and so on. The following image shows how a complex cracks can be seperated into those branches.

cracks_breakdown

Branch Generation

The following image explains our approach to approximate the shape of a crack. We can see that crack can be split into big segments (in blue) that can be split again into smaller segments (in red).

cracksIn Blender, we define a general direction for the branch, and generate points along it with small angle variations between each point. By default, every 5 points generated, we created a bigger angle variation (corresponding to the blue one in the image). We then convert theses points to a Curve Object.

Children Generation

Cracks appear way too smoothWhen each point is generated, we generate a random value between 0 and 1 and look if this number is smaller than the Children Probability defined by the User. If it’s the case, we create a child branch at the point position and store it’s relative position on the master branch. For example, if the tenth point of a branch composed of forty points has a children branch, we create this new branch with a ‘relative position in the master branch’ of 25%. This will be very useful when dealing with the animation.

As the algorithm for branch generation is recursive, we need a way to stop it. To do so, we simply decrease the child probability at every generation, so each generation of children is ten times less likely to have children than its parents.

 

 

 

More displacement on cracks

Displaced
The  previous image shows how, even if we have generated cracks with big angle values, it still appears too smooth. We need to add more displacement on the cracks. To do so, we subdivide each curve several times, select randomly some points on it and move them using the proportional editing tool with a random falloff. After some test, we found out that we have much better result by repeating this operation with small values several times instead of doing it in one go.

The result is far more convincing with little displacement along the cracks. However, this step currently produce a small but annoying bug where some roots of some children branch get disconnected from their parent because they are displaced under the effect of the proportional editing tool. This bug is currently being fixed.

 

Animation

The animation system is fairly simple, we key the End Bevel Factor parameter to animate the growth of a branch. However, by doing such, the growth is very linear and robotic. So, we have added a parameter to control the speed of growth and make it randomly go faster and slower during its generation. We simply subdivide the F-Curve for animation and change the position of the keys in the Y axis as illustrated in the following image :

anim_curve

Results !

The result is visible is the following video :

The script is used to generate the cracks and their animation as you can see in the following video. We use custom attenuation and displacement on cracks to get a more believable result.

0230

In order to make cracks interact with other object and surface, we need to export it as a sequence of images with transparent background. We will then be able to plug this sequence into a material or a modifier in the scene and generate cracks easily in the scene. On the left we have an example of one of these image. To render it, we simply do an OpenGL Render from the top view with an orthogonal camera. We also have applied a simple material with a black&white colorRamp so we can destroy the edge of the cracks later on.

The image sequence is then used in the scene file, as a factor for displacement modifier on a highly displaced plane and as a mix Factor on the concrete material. As we have loaded an image sequence, we only have to set the right number of frames to use and Blender will automatically refresh the image number to match the current frame and we have our animated crack !

 

Todos and limitations

Currently, the tool is very limited and could be largely improved by adding new features like cracks generation snapped directly on a 3D surface. This is doable as we first generate a point cloud, we could snap each point on the target surface as we generate them.

One of the biggest limitation is the fact that we don’t have access to all the modifiers we want as we manipulate curves. For example, we don’t have access to dynamic painting or boolean modifiers. Keep in mind that this a tool to generate background and secondary animation in some timelapse sequence. Our needs are quite limited and our plan is to generate a few different cracks that artists can then plug easily into their scene and add some details without spending days with painting cracks manually.

Download

The script can be download here. For now, it is only a script, so you’ll have to load the file in the blender text editor and run the script from here. Cracks Generator is added as a new tab in the tool-shelf of the 3D View.

 

 

 

Texturing and adding dirtyness

Version française en dessous. hi, For the last few week, I’ve mainly done some modeling trying to add as much detail as I could so we can use the models in the various close-up shots we have on the tracks. I had to model various little objects to “populate” the scene. I also started the […]

Version française en dessous.

hi,

tracks texturedFor the last few week, I’ve mainly done some modeling trying to add as much detail as I could so we can use the models in the various close-up shots we have on the tracks. I had to model various little objects to “populate” the scene. I also started the first texturing tests for all our various models. Until now, we’ve mainly modeled objects but we only have a few textures and materials because we were waiting to see how blender internal is going to evolve with project Durian. We were especially expecting to use the ‘material refactor’ which would allow us to have better shading. Unfortunately, with Brecht’s departure and all the other work on 2.5, the project seems to be stopped for the moment…

In this post, I’ll try to explain how I textured the concrete support of the tracks using material nodes.

The basic idea for this model is to have old and damaged concrete blocks, covered in oil. I started sculpting some cracks, details and broken parts. Here is the model before starting texturing :

The next step was creating two basic materials, one for the damaged parts and one for the regular concrete. i tried to use procedural textures as much as possible to avoid resolution problems. Then I painted a texture to tell blender which part of the model receives each material. Finally I mix everything in the node editor :

So far my concrete block looks like this :

It’s not bad but it’s not really realist. The next step consists of adding all the oil splatters. As I have two different materials, it’s easier to add these splatters using nodes. I’ve used an overlay mix to composite my generic oil map over my base material. By using the ‘mapping’ node, I could use the same map several times and play with scaling and rotation values to add variation.

Here is the final node setup for the concrete material :

And voila! this is a quick method for adding dirt to a material without having to paint a texture in gimp!

French version :

tracks texturedCes dernières semaines, j’ai principalement fait du modeling pour le projet en essayant de détailler un maximum pour pouvoir utiliser les modèles dans les nombreux plans où l’action se situe sur les rails du métro. Il m’a fallu modéliser pas mal de petits objets divers pour ‘peupler’ la scène. Mais j’ai surtout commencé à faire les premiers tests de textures pour les différents modèles. En effet jusqu’ici nous avons surtout des objets modélisés mais très peu de textures ou de matériaux car nous attendions de voir comment le moteur de rendu de blender allait évoluer avec le projet Durian et notamment nous attendions de voir si nous pourrions utiliser le fameux “material refactor” qui nous permettrait d’avoir un shading bien plus réaliste que ce que nous avons actuellement dans blender. Malheureusement, avec le départ de Bretch et la sortie de la 2.5, le projet semble être remis aux calendes grecques…

Dans ce post je vais détailler comment j’ai texturé la base des rails en utilisant et en abusant des nodes !

L’ idée pour ce modèle est d’avoir du vieux béton abimé et couvert d’huile. J’ai donc commencé par sculpter les détails, par ajouter des craquelures et par ‘casser’ un peu le modèle. Voici à quoi il ressemble avant de commencer le texturing :

La première étape a été de créer deux matériaux assez basiques, un pour les parties abimées et un autre pour les parties en meilleur état. J’ai essayé d’utiliser au maximum des textures procédurales, histoire de ne pas avoir de problèmes de résolution. Ensuite j’ai peint une texture pour déterminer quelle partie du modèle recevra quel matériau. Et enfin grâce aux nodes j’ai mixé le tout.

Et voici à quoi ressemble mon bloc de béton à cet instant :

C’est pas mal, mais pas franchement réaliste. L’étape suivante consiste donc à ajouter de nombreuses taches d’huiles qui vont salir un peu tout ça.  comme j’utilise deux matériaux différents, le plus simple est de rajouter ces taches d’huiles via les nodes. J’ai donc utilisé une map générique avec des taches d’huile que j’ai superposées à mon matériau de base. En utilisant le nÅ“ud “mapping”, on peut utiliser la même map plusieurs fois en changeant sa rotation ou son échelle…De cette façon on ne voit pas la map se répéter et le résultat est bien plus réaliste :

Et voila le setup nodal final, vous pouvez voir dans la zone légèrement sur-éclairée toutes les couches nécessaires pour ajouter les taches d’huiles  :

Et voila, grâce à cette méthode, on peut très facilement salir ou vieillir un objet sans avoir a passer par Gimp!

Happy blending !

Bonjour a tous !

Hi everybody, First, let me introduce myself, I’m Henri Hebeisen from France and I’ll work as a 3d intern for the two months. 🙂 I arrived last week after a long plane trip, so I`m still discovering the `american way of live`.Living here seems really great! 😀 I’ve been working on the  project for less […]

Hi everybody,

First, let me introduce myself, I’m Henri Hebeisen from France and I’ll work as a 3d intern for the two months. 🙂 I arrived last week after a long plane trip, so I`m still discovering the `american way of live`.Living here seems really great! 😀

I’ve been working on the  project for less than one week now and it’s very exciting to work on it. Everybody is really nice and that’s a pleasure to work here. Bassam showed the animatic last friday, the story is just…incredible!!The final result will be “epic”! (a popular word for blenderheads these times 😀 )

So my first task here was to do some tests for a shot Bassam had in mind. The idea was to play with the curves of the metro rail and have nice shapes when the camera is flying over really fast. So as we wanted to have the impression of movement really early, I just did some basic drawings with Inkscape and then projected these drawings on planes in blender.

Using Inkscape was quite useful because it allowed me to do several variations of the curvy tracks fairly fastly, just had to play with layers and positioning curves and

And then back to blender, it became very easy to position the camera, control the speed and so on… 😀 Here is a picture of what it looks like in blender :

As you can see, it’s very simple and it’s a good way to visualize the curves in movement.

Once we had a strong idea of what the shot would look like, I started to model the tracks in 3d and made them fit it with the inkscape drawings. Et voila, that’s it!

2010/06/test0001_0235
©URCHIN 2015