I am trying to create a cracked ground appearance for an animation that takes place in the desert. something like the image here:I would like to do this all in blender, and have blender generate the texture so I will not have to worry about unwanted ridges like those you would get in an image from the internet: I am wondering if there is a way to procedurally generate these cracks and use them with microdisplacements. Thank you!
Since BI was already mentioned, I'll try to tackle Cycles. The Blender 2.79 Candidate Build now includes a working Microdisplacement. You can enable it by changing the feature set to Experimental (must use CPU rendering) and under the Materials tab, set Displacement to "True" or "Both".
Now to address your application. First, there is no simply no way to model real, cleaving, natural-looking, dried clay with microdisplacement using a 2D Texture (generated or otherwise). If you look carefully at the photo you posted, the blocks fold under themselves. The sides are textured in the same way that the tops are. There's no way to do that without modeling geometry.
The reason is because the displacement affects the mesh in relation to the normal of the underlying geometry... a top-down approach. This is why you need subdivisions. This makes files, BVH cache, and rendering extremely bloated and time-consuming.
Now, let me explain why using "an image from the Internet" is not the biggest problem. I procedurally generated this texture using Cycles nodes. Currently, there's no way to use "Crackle" with nodes so this is a hacky way of creating a similar effect. It takes the difference of two identical Voronoi Cell texture nodes that are slightly offset using the Mapping node.
But even though this is procedurally generated, you can clearly see the stair-stepping. That's because the microdisplacement algorithm attempts to produce the generated geometry as quads and the contrast between the edge pixels in this noise texture is very high (similar to your second picture). The mesh grid is mapped onto the texture and a value (height) is assigned to each quad. Observe:
So you either need eased-edges (blurry corners) or you need a lot of subdivision or both. Fortunately, the 2.79 build also comes with Adaptive Subdivision so you can have lots of subdivision up close and less as distance increases. In layman's terms, it does this by dividing the Camera Plane into sections and subdividing the meshes based on how many subdivisions are required for a particular section. This is determined by the Subdivision Rate you set in the Properties>>Render>>Geometry panel as well as the Dicing Scale in the Modifier pane. For instance, if you set the Subdivision Rate to one pixel, it will subdivide the mesh so that each quad is the size of each pixel of the final render.
So while you can technically do this procedurally by using the Voronoi noise, you gain almost nothing over an image texture. In fact you'll have to do more processing and tweaking in order to generate the proper noise required to make the edges frayed and random. Then you'll need to generate a texture for the top using several more noise nodes.
The image I used for this render was downloaded from Google after 20 seconds of searching. It's resolution is 1300x1300 (I doubled that with Photoshop and then blurred it slightly). I created two UV's (one for the detail cracks, one for the large cracks) and I used the same image for both. I added a noise texture to give it a little more unevenness. (Heat distortion effect done in Photoshop)
Here's the blend. Make sure you have the 2.79 build and then download your favorite cracked earth image texture:
If you're using Blender Internal (or LuxRender) you can use the Voronoi Crackle noise type. Unfortunately Cycles doesn't have this at the moment, so you'll have to use something else if that's the case.
Anyway, start by adding a texture over in the Textures tab of the Properties panel. Change the Type to Clouds and the Basis to Voronoi Crackle.
Next, scroll down to the Influence section and uncheck all the Diffuse boxes, and check one of these two boxes:
- Normal (first under Geometry) if you want 'fake' bumps that don't actually displace anything. This is good for surfaces that you aren't looking at edge-on, but if you do, you'll see that it's actually flat.
- Displace (third under Geometry) if you want to actually displace the surface. If you do this, you'll have to subdivide the surface a lot – the Subdivision Surface modifier with the algorithm set to Simple will come in handy. This tends to be harder to work with, but you may need it if you can't get away with plain normal mapping.
If you don't want to go to the trouble of UV mapping, set the Coordinates to Generated or Object (in the Mapping section). You can also use the Size fields here to adjust the scale to your liking.
Also, note that Cycles can do this normal/bump mapping just fine—you'll just need an image texture instead of the Voronoi Crackle, or you can try something with a plain Voronoi texture.
You have the fractal system too, but is to expensive for the memory, cause this method manipulated the mesh... But if you're using the displacement modifier, you are manipulating the mesh too. My recomendation is: use microdisplacement with Voronoi texture, to make procedural "crackles", and image texture to make "PBR" crackles.
This tutorial is so good, there Alex explain how to do microdisplacement with image texture and how to economize memory.