Virtual Creation: Painting the Beach

Slowly but surely I’ve been building this beach scene. First I set up the scene basics. Then I added some background details: a forest and a sailboat. (I had planned and done more, but the program crashed to desktop before I saved my progress.) Looking at the earlier pictures of the series, I think I need to make the beach look more… well, beach-ish! So today I’ll shade the beach!

Ok, to start I’ll select the beach terrain and jump into the shading room. I’ve included the original shader for comparison’s sake below.

Image 1. This is what we start with…

Note that it’s not very complex; there isn’t much going on at all. However, it’s important to know how this shader works, because I’m going to change it to produce the appearance I want. So far I’ve used multichannel shaders. Multichannel shaders affect different parts of an objects appearance, like color, reflectivity, translucency, refractivity, and surface texture (bumpiness). They’re the workhorse of shading. However, for this we’re going to use a more complex shader, called a terrain shader. Basically, this is a master shader that displays a list of other child shaders as layers on the object. To make sure that more than just the top layer shows, each child shader has a distribution shader associated with it. We’ve already seen these — it’s what I used in Virtual Creation: Background Details to make sure that the forest stayed off of the beach. Basically, a distribution shader is a grey-scale map. If the distribution shader shows white, that layer is opaque, and you can see the child shader for that layer. If the distribution shader is black, then the layer is invisible, and you can see the layers below. Anything in between (some shade of grey) results in a partial transparency; you’ll be able to see some of this layer, but some of the layers beneath it will also show. Doing it this way means that each different terrain types can be handled as a separate layer, and the distribution shader will take care of any blending necessary as things move from one terrain to another.

Image 2. Here you can see the three layers of the terrain shader. The brown is the base layer, and will only be seen if none of the child layers appears. The red is the first layer, and will eventually become our beach. The grey is the dirt layer which will sit under the forest.

The image above is the first draft of the new terrain shader. I’ve made the child shaders into multichannel shaders; for now, however, I’ve simply set a color so that I can get a feel for the placement of the layers. The top shader on the list is the bottom-most layer; for illustrative purposes I’ve colored it brown. It’s the color that will show anywhere that isn’t covered by one of the other shaders. The red color is the middle layer; that will eventually become the beach itself. The last layer, the grey one, is actually a copy of the distribution map for the forest; this layer will eventually be brown dirt for the forest’s roots. (I realize that on many tropical beaches the trees and plants grow directly out of the sand, but on this island there’s soil.)

Image 3. Here’s a first draft of the dirt layer meeting the sand layer.

With the three layers basically in place, I start tweaking the colors to get things to look the way I want. I move the camera in close to check the fine detail; as I’ve said before, it’s often the small things that can make or break suspension of disbelief when looking at a virtual photo. After half an hour or so, I get something that looks pretty good in preview, so I drop back into the assembly room to run a quick preview.

Image 4. A first draft of the beach shader.

Yuck! Although it looks better than what I started with, the sand isn’t really all that attractive. It looks a bit too brown and drab. Also, I’m not crazy about the color of the dirt; it looks too red. Back to the shader room for more work. I continue tweaking the colors; I darken the color of the dirt, making it more brown, and work on making the sand a lighter shade of cream.

Image 5. In the preview pane this one looks pretty good…

After another hour I’ve gotten the dirt to a nice rich brown shade, but the sand just won’t cooperate. Although the preview looks good, the actual render turns out less pretty. Instead of getting frustrated, I’ll move on to the sailboat in the distance, and promise myself I’ll continue working on making the sand look better.

The “render so far” (see below) took 1 minute and 12 seconds, almost 5 times as long as the one I did at the end of the last post. Although I didn’t add any new objects, the complexity of the new shader requires a longer calculation time.

Image 6. The render so far. Not quite a beautiful tropical beach yet, but closer than ever!

At this point I’ve got a beach scene, even if it still has some pretty major issues. The sand still needs some major work, and the water line doesn’t look quite right, either. However, I believe that next time I’ll add and place the foreground elements; once that’s done I can return to the task of getting the shader details right.

Your Thoughts