Sunteți pe pagina 1din 9

Intro to the Fake Stones Shader

By Neuspadrin

Intro to the Intro


After finishing up my first video tutorial I was asked by Folder if I could do one on fake stones. Well, here you go. Fake stones are a complicated thing to do in Terragen 2 at times, but once you understand them it can produce some amazing results. The key to fake stone shaders really is to understand some of the other shaders inside Terragen and how to use them with a fake stone shader to get realistic results. I'm in no way a pro at them either yet, but I feel I can help introduce some of you guys into how it works. For the pros, you should check out NWDA. If you have any questions, feel free to contact me on the forums, my username is neuspadrin.

How to Read the Tutorial


I will use a few shortcuts and such in the tutorial, such as abbreviated names (Power fractal = power fractal shader v3), and most likely won't include the word shader at the end of each one as pretty much everything we will be working with ends with that word. Also, I will use arrows like this to signify buttons to click. Example: Add Layer Colour Shader Power fractal shader v3... and they will be in bold to help notice what is part of the addition. It might be abbreviated to add colour power fractal. And yes, they use the British spelling (planetside.co.uk). I might accidentally slip occasionally and put color. Add layer will be just add, and add child layer will be add child. When using add child, make sure you select the fake stone shader if I just say add child or whatever shader I tell you to add the child to in case its to a different one.

Checking out the Fake Stone Shader


First off, we will be learning the basics of a fake stone shader, and the options available to it. So switch to the tab. Add displacement fake stones. Yay, stones! Tutorial done. Oh, more? Ok... So what do all the various boxes do? Well below are a few settings changed in the first tab (Scale / density), and the effect it has on the overall stone.

Scale/Density Tab Scale

0.5

1.5

As you can see scale makes the stones get smaller or bigger overall compared to everything.

Density

0.5

As you can see, density is the how much ground cover the stones take up. 0 being 0% up to 1 being 100%.

Vary Density etc


This, and the two shaders under it are a bit harder to show with quick images how they work. They really have to do with how the density varies, and how much to change the scale of the rocks.

Shape Tab Stone Tallness

0.5

As seen above, stone tallness just does what it says. Makes your stones tall/short. It stretches them up and down depending on these factors.

Pancake Effect

These pictures don't show it the best, but pancake effect essentially is like if the rock was squishy, and you pressed down it would shoot the sides out, and flatten the top. Below is a bigger image with some extreme pancake to try to show you what I mean.

I had to change the view a little to get in what was happening, and Included the shader top preview that also shows a little of what is going on.

Colour Diffuse Color


This really doesn't need too much explaining or examples, it just diffuses the colour making the stone overall lighter or darker.

Colour Variation
This changes the color of the rocks by set amounts of red, green, and blue. The values range from 0 to 1, which is basically 0-100% variation. For below, only the one color changes, the others remained .5. 0 Red 1

Green

Blue

Overview of the Fake Stone Shader


So, we have now gone through the various important internal parts of the fake stone shader, and shown what effect they have on the stones. But the realism doesn't come from the fake stone shader, just plain by itself. It only creates the base of what we use to get the stone shapes, from there we tweak them with displacement shaders to get them the way we want. The next parts of this tutorial will go over a few shaders that can be useful in making cool stones, and show their effects. So the goal really is to find a seed of stones you like, that generally have the shape you want, and are in the places you want. Everything else falls under the combination of other shaders.

Using the Power Fractal for Displacement


We first will cover the usage of the power fractal to cause displacement on the stones. To simply things and show differences easier with extremes, I will be using a stone scale of 100. The size of your stones that you want to use play a big role in the sizes of displacement later on. So when I choose values, depending on the sizes you choose, you will want to pick different values, higher or lower. I will be using the stone in the picture to the right here, as my close up view of what the rocks look like. Making boulders realistic is one of the harder things. Very small stones are a lot easier to use fake stone shaders on as it only requires a few tweaks to get them nice looking, as you can just apply a little displacement and some color. So, lets get started: Add child displacement power fractal. We now have a power fractal added. It will look a little bumpy (Fig. 1). It's a step in the right direction towards some realism. But these white stones are getting a little annoying, so lets put some nice rock like colors in them. In the power fractal, switch to the color tab, and make sure apply high colour is checked, and check the apply low colour. Now we pick some rocky colors. I'm going for a gray rock, so my high color will be .3, and my low color will be .05. Doing this gets me the results in Fig.2. Now, displacement plays a big part in realism, and right now its just a bumpy mess. You can change this by changing the feature scale, lead-in scale, smallest scale, and the displacement amplitude in the power fractal shader. The higher the feature scale, the more tamed down they are. I changed the camera angle, but see Fig. 3.

Fig.1

Fig 2

Fig 3

We can also go to the displacement tab and change the amplitude of displacement to something higher, I set mine to 10 and got the Fig 4. The thing about displacement is it can occur on the normal (straight out from whatever angle it is), or you can set it to do things such as vertical only and lateral only. Fig 5 has been set to only vertical displacement. With this rock it doesn't change much as most of the displacement was vertical only as is. Fig 6 shows what lateral only can do, which is quite a bit different. It makes it so the only displacement that happens is if it is in a lateral motion, instead of doing vertical displacement. This leaves the top of the rock quite smooth, while making the sides very broken up.

Fig 4

Fig 5

Fig 6

Using Twist and Shear


Twist and shear is another displacement shader that can sometimes create some interesting stone shapes. I started off with a new scene for this one, add displacement fake stones, then add child displacement twist and shear. I made the stone scale 100 again, for ease, and I also added a child layer of power fractal, with displacement unchecked so it just gave it a stone color. With the twist and shear disabled, it looks like Fig 7. With the default one enabled in my scene, it looks like Fig 8. A twist and shear shader, is somewhat like the pancake effect. If we think about the rock as a squishy object, it's like the weight of something is pressing down on one side causing the rock to squeeze out the other way. The lean directions are in x, y, z, and negative values lean it the opposite way. The lean factor increases all the leans by that amount. Base altitude is a pretty cool thing, it can make it so the twist and shear shader doesn't do any changes until you hit that altitude. See Fig 9 for an example of my stone set with a base altitude of 30. As you can see, it goes up to an altitude of 30 normal, but then twists like before.

Fig 7

Fig 8

Fig 9

Using Redirect
Redirect is a VERY powerful shader that can get some very nice realistic effects. I started by just deleting the twist and shear shader from above, so I was back to the same scene as Fig 7, also above. Add child displacement redirect shader. At first a redirect does nothing when added. This is because it relies on other shaders to create the redirect. I most often use a power fractal. So below are 3 images, with the exact same shader put on x, y, and z. To add the shader click the button, and choose create new displacement power fractal. Now click the + again, and click goto. I set my displacement to 50.

As you can see they displace in the directions they are set for. You can really do a combination of each displacement effect or a mix of them to create some pretty cool things.

Making Stones
So, we have gone over the shaders that are important in stone making. It's not just the fake stones shader you need, its the other more powerful ones that bring in the awesome rocks. So now it's time to combine up the knowledge from earlier to make some boulders. So we start from the beginning, a brand new scene. Add displacement fake stones. I'm going to use a stone scale of 100 again, but keep everything else default. Now this time I want just one stone really, so I'm going to blend by shader, create new colour distance. I'm going to tell it to invert the blend shader, and then goto it. I used the measuring tool to measure the distance from the camera I wanted the stones to stop, and I set the far distance to that distance. I set it spherical from the render camera. What I got is to the right. Now I want to set up some displacements for this rock and get it started. For this I am going to use twist and shear first. Add child displacement twist and shear. I liked the lean factor it was at, and the direction, but I wanted it to have a base altitude of 10. Next I will add the redirect layer, so I will add child displacement redirect. I will be using 2 power fractal shaders, one in the X shader, and one in the Z shader. To add both of them create new displacement power fractal on both. Now I'm going to adjust them slightly to get the displacement amplitude and scale I want.

I've also moved around the rock to get a angle and displacement I liked in it. I set the scale on both fractals to 10, and the displacement amplitude to 50. To the right is what I have so far for my boulder. But it is very obviously missing colour. Now boulders can have many colors in them, so really the best option is to use a couple child shaders without displacements to create the color distribution you want. You should blend them using fractal breakup and such so that they can go over each other and add to the realism. You can also add a reflective shader to make the rock look wet, or you can make it look like its got something shiny in it, like gold specs. I'm going to do some modifications myself to mines color, it will be available for download so feel free to download the file and see what I did. I'm also going to add some of Walli's free grass into the image just to give it a little more realism for my final render.