|
The key thing about the Stone Roses, Pineapple Forest and Termite Cooling Mounds images / materials is that they all rely on having an underlying Mountain Height texture with a matching Sparse Convolution noise. So, this material tutorial is going to start first with a single-leaved Mountain Height texture on an otherwise flat planet. The way it's all built and put together, though, will allow you to add in your own terrain features to the Mountain Height texture, yet still have the material 'line up' with the underlying terrain. Another key to creating these effects lies in how displacement works. Displacement pushes the planet's surface out perpendicular to the slope the planet has at that point, so the steeper the slope, the more dramatic displacement is. The basic idea here is to create discrete spots where the slope will be very steep, then to use a clone of that same texture leaf which creates the steep spots to control the blending. This means that the other parts of the terrain can also have steep slopes, but those slopes won't have the same displacements as the few discrete spots. So, there are 'termite cooling mounds' but not 'termite cooling _cliffs_'. The Underlying Terrain Start with File->New. Open the terrain texture editor. Create a new texture. Enable the first texture leaf. Open the leaf's kickstand. Give this leaf a recognizeable name - I called mine 'mounds'. Change the MonoFractal to Noise. Change the Noise's Basis Function to Sparse Convolution. Some notes about what we've done so far - the reason we use Noise and not a fractal is because we're going to be applying some serious displacements to these features and serious displacements work best when the underlying terrain is _smooth_. We'll come back to that concept at the end when it comes time to add more interesting features to the terrain texture. A note about scaling the LFS of the noise - when I've made my Stone Roses, Pineapples and Termite Cooling Mounds, the LFS I used on the Noise was set very small, like around 5 or so. But I'm sure that some _very dramatic_ effects can be had by setting the LFS larger. You'll want to remember how large you've set the LFS on this Noise, though, because the scaling of the distortion you add will probably depend on the scaling of your 'mounds'. For this tutorial, my example uses 100 for the LFS:
The underlying Mountain Height texture The next note on scaling has to do with the vertical scale. Vertical scale can be created either by changing the Result Scale or by using the Curve editor, or a combination of both. For a ballpark figure, I've used a vertical scale about equal to the LFS on the Sparse Convolution Noise. My personal preference is to leave the Result Scale set to 1 and handle all the vertical scaling through the Curve Editor. Here's the Curve Editor I used on this first leaf of the terrain texture:
Create vertical scaling with the Input Curve One last note on scaling has to do with the details in the Basis Function editor for the Sparse Convolution Basis. For the 'Splat Kernel', I recommend sticking with the Soft Cone, though the Hemisphere and Cone kernels may also be good choices. The other Splat Kernel choices probably aren't going to be as sucessful because they are concave instead of convex (for the Sharp Dish and Dish ones) and / or have edges that are 'too sharp' (for the Disk and both of the Dish ones). For the Kernel Radius, I've often made it smaller than the default of 0.5 in order to increase the separation between the mounds/towers/whatevers. Another way I've increased the separation was by choosing the '0-1 Seeds, Uniform' Seed Table. Here's a shot of the Basis Function editor for the Noise:
Details of the Basis Function And if we render now, this is what we've got so far - a boring flat planet with soft cone mounds - the camera is about 20-some-odd meters off the ground in this view:
A render of our planet so far... The Material Displacement Now it's time to go play with material displacement. I'm not going to bother talking about the Diffuse color or any of the other material parameters, because once you see how the displacement gets blended, the same technique (and indeed, the very same texture leaf!) can be used for the blends in those other material parameters, and/or used to blend between two material leaves. Go into the material editor for the planet's material. Select the material leaf. Change the Displacement parameter to a texture. When the texture editor opens, create a new texture. Enable the first leaf. Open the leaf's kickstand. Name the leaf 'null'. Change its MonoFractal to None and change its input coordinates to Constant. This is because we want to have no displacements except where the mounds are. So, this leaf outputs a constant 0 for no displacement. The leaf's kickstand looks like this:
The 'null' leaf Enable the second leaf to provide the texture for our dramatic displacement. I named mine 'fun'. This is where you're really free to get creative as far as choosing fractals and basis functions. The important things to know are that you'll probably want the LFS on this texture to be at least an order of magnitude smaller than the LFS of the bumps texture and that it takes negative values to push the planet's surface out. For the Stone Roses, the LFS was about an order of magnitude smaller. For the Pineapples, it was more like two orders of magnitude smaller to get that really spiny effect. My displacement texture for this tutorial example with the 'fun' leaf expanded to show its fractal's parameters looks like this:
The displacement texture so far... As I usually do, the Result Scale is left at 1 and the 'vertical' scaling comes from the Curve. ('Vertical' in quotes because it's actually going to be mostly horizontal - it's the amount of the displacement...) A shot of the curve editor follows - the min / max inputs are -0.7 and 0.7 because it's been my experience that's the range of output which comes from the default Value/Gradient Perlin basis function. The min output is -20 and the max output is 0. That'll push out the sides of the mounds between 0 and 20 meters.
The curve creating the amount of displacement Now for the key to making it all work - the blend between the 'null' and 'fun' leaves. It needs to be a clone of the 'mounds' leaf from the terrain texture. But there's a limitation in the texture editor in that you can't set the blend to type 'blend' and then clone the leaf there... So we need to set one of the two existing leaves to 'mounds' first, clone it, re-name the clone as 'mounds blend' and then set the leaf back to what it was. I'll go through that again with a screenshot for each step because it's quite potentially confusing. Step 1 - open up the DDLB for one of the two leaves and change the leaf to the 'mounds' terrain texture. I've chosen to use the 'fun' leaf, but you can use either one:
Step 2 - right-click (PC) or control-click (Mac) on the circle-T to make a clone of the leaf:
Step 3 - rename the clone from 'mounds01' to 'mounds blend', then use the DDLB to set this leaf back to what it originally was:
Step 4 - open up the blend between the two leaves and change it to 'blend':
Step 5 - use the DDLB to change the blend texture to the 'mounds blend' clone you created in step 2:
It's because there's no way to clone a texture leaf when it's in that blend slot that we had to go through all those hoops first. There are two more things that need to happen to this blend texture before we're ready to make another test render. The first is that the input coordinates need to change from 'World Position' to 'Undisplaced Surface Pos'. Technically, you can get away with just using 'Surface Pos' here, but if you're going to use the same leaf to handle the diffuse color blend or any other material parameter's blend, you'll want the Undisplaced Surface Pos. I'll revisit the input coordinates at the end to show an example of the differences between World Position, Surface Pos and Undisplaced Surface Pos. For now just trust me and go with the Undisplaced Surface Pos.
The displacement blend The second thing isn't super-urgent like the input coordinate change was, but you'll probably want to tweak the Curve Editor. For one thing, since this texture leaf is driving a blend, it should really output a range of 0 (where it'll apply the first leaf) and 1 (where it'll apply the second leaf). That means the Max Output of 100 we've got is a little out of line. Change Max Output to 1.0. The other thing you may want to play around with is the Max Input. I've set mine to 0.1 so that the 'fun' displacement applies full-on to the mounds starting right near their bases. If it's left at 1.0, the displacement will gradually apply, gently blending up the mounds.
The blend texture's curve That's basically it - have a peek at what the planet looks like now:
The displaced mounds Mountain Height Revisited The beauty of the way this is all set up is that the terrain can have more mountains added to it without affecting the integrity of the displaced mounds. Up to three more leaves can be used to drive the Mountain Height texture. The blend between the first 'mounds' leaf and the other leaves needs to be 'add' so that the mounds are added in to whatever terrain is created by the other leaves. As a simple example, I've enabled a second leaf to add in some mid-range sized mountains:
Mounds on mountains For a more complex example and to get back to that point about keeping the underlying terrain smooth, take a look at these three similar images:
Effect of Smallest Feature Size Note how in the image on the left, the displaced mound is kind of 'flaky' at the top and there appear to be some places where 'redo blocks' didn't get it right. This is because the SFS of the added in mountains leaf is set to 0, which ruins the smoothness of the mounds. The image in the center has the SFS of that added in mountains texture leaf set to 10. The displaced mound now looks much better, but the mountain behind it looks too smooth. What'd be really cool is to have the SFS be 0 where the mounds aren't and have it be larger where the mounds are. That turns out to be really simple - just drive the SFS of the added in Mountain Height texture leaves with the very same 'mounds' texture that creates the mounds in the first place. It doesn't have to be a clone with different input coordinates - the World Position coordinates work fine in this case because it's all part of the Mountain Height texture, and when calculating the Mountain Height texture, the World Position coordinates are automatically forced into being the same as Surface Position. Input Coordinates Revisited I just said that when the Mountain Height texture is being evaluated, it treats World Position the same as Surface Pos. The reason Surface Pos exists is so that textures applied to the parameters of materials (such as the diffuse color, etc.) can be forced to line up with terrain features created by the Mountain Height texture. When a texture is evaluated in World Position, it takes the point it has 'now' and evaulates the texture there. For the purposes of most textures, it's fine to just take the point it has 'now'. This next series of images shows the same scene with the diffuse color being blended using a clone of the 'mounds blend' leaf with a variety of input coordinates. In the first two, the displacement has been disabled:
World Position / Surface Pos / Surface Pos with displacement / Undisplaced Surface Pos The blend between the plain grey color and the solid red color is a texture leaf using that same Sparse Convolution noise that we've used all along throughout this tutorial. To get why most of the mounds are red only at the base and are grey at the tops, you need to know that the Sparse Convolution noise is three dimensional - don't picture it as a set of circles on a plane, but rather as a set of _spheres_ floating in space. The mounds poke up out of the spheres of the Sparse Convolution noise and the blend saying where the red should go is limited to a spherical volume near the bases of the mounds. Using Surface Pos fixes that problem - the blend doesn't use the spherical areas, it uses only the circular areas where those spheres intersect the raw surface of the planet (where the planet's surface is before any Mountain Height texture is applied). But then, when we add in the displacement, look what happens! The displaced sides of the mounds poke outside of the circular areas where the spheres of the Sparse Convolution noise intersect the raw surface of the planet. This is a cool effect in its own right, but since the goal is to have the mounds be solid red and only the non-mounds parts of the planet to be grey, the solution is to use the Undisplaced Surface Pos - the color applied to the displaced sides of the mounds is the color from inside the circular area where the Sparse Convolution noise intersects the raw surface of the planet. Whuf! I know that's a lot of complex stuff. Work through it a few times and hopefully it'll start to make sense. I've got a sample planet which doesn't have that red / grey stuff in it, but has all the other stuff in it. Have Fun! |