Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more CAD and personalized recommendations.Start Your Free Trial Now
- View Offline
- Installing V-Ray
- Creating natural daylight with V-Ray Sun and Sky
- Bouncing light around with irradiance mapping and light caches
- Setting up a depth-of-field effect
- Creating diffuse and reflective surfaces
- Working with the Adaptive DMC engine
- Manipulating color mapping
- Adding caustic lighting and occlusion effects
Skill Level Intermediate
One of the big reasons for working V-Ray as a rendering engine in SketchUp is of course its ability to create and render extremely realistic materials. One common element in material creation is the use of grayscale images to produce the appearance of bump, or surface, detail in our objects. This goes under the descriptive name of bump mapping. Oftentimes this simple render engine trick isn't of to add the desired level of extra believability to our scenes.
At other times though, we may need, or indeed want, something that adds a little bit more. At such times displacement mapping may be capable of providing that extra quality for us. Now initially, the two can appear to be very similar, as they both make use of grayscale images to produce a particular effect. The final rendered result, however, will show that what is going on behind the scenes is really very different indeed. Whereas bump mapping is just an optical illusion created by the render engine--something that gives us the impression of height or depth in a material-- displacement, or render-time displacement to be more accurate, gives us real geometry in the scene.
It gives us depth to our meshes. This of course means that scene lighting and material elements such as reflections and refractions can appear much more believable than with simple bump mapping alone. In this video we're going to step through the process of adding a little extra realism or life to the outdoor portion of our scene by adding some displacement to the geometry of our pool water. Of course at this moment in time it would be a good thing to go and take a test render, just to see what we have, so we can see the difference between our base render and what we end up with in our displacement effect.
Whilst our pool water is behaving realistically in terms of its reflections and refractions, it is looking a little bit lifeless, a little bit artificial. That's what we hope to cure by means of displacement mapping. If I just dismiss our V-Ray Frame Buffer and select our water geometry, I'm just going to select the Move tool and just show you that this is indeed just a single-plane object. So if I just Alt+Backspace to revert that back to its original position, this is just a single-plane object, but it has been converted into a group.
For displacement mapping to work with V-Ray, the object must be a group, even if it clearly is not a group of separate objects. We can do that quite easily by just selecting an object in V-Ray, coming up to the Edit menu, and clicking can Make Group, which of course is grayed out at this moment in time because our object already is a group. Now because displacement mapping is in effect that is created through our materials, we need to go and open up our V-Ray Material Editor. So up to the V-Ray toolbar, click on the M for a Material Editor, and in the list of scene materials, we want to come and select Pool Water.
Now one thing you may be wondering about is the file that clearly from our SketchUp viewport, there is a Diffuse material applied to our water geometry. This is been applied so that we can set the UVW scale for our texture. This is the same texture that we'll be using for our displacement mapping, but if we just come up to our SketchUp Paint Bucket tool, and if we come into the In model material, you'll see we have out Pool Water material, And if we come to Edit, you can see our UVW scale is already set up.
We need to texture in here to be able to do that. We've however made certain that this Diffuse Map does not show up at render time. We've done this by coming down to the Transparency Slot and in the Map Slot, you can see we've added a TexAColor. We've set this to a value of pure white, which means we have complete transparency, so far as the diffuse channel in concerned in connection with our material. And of course, you've already seen in our test render that this map doesn't show up at all. To create displacement on our material, we need first of all, scroll all the way down to the bottom of our Material Options, until we come to this Maps rollout.
As you can see, one of the options is to create displacement mapping. To enable that of course, we need to put a check in the box, and then we can come to our Map Slot to add the required displacement image. Now we could choose a Procedural Map from the list, but in this instance we want to work with a bitmap image, so we're going to choose the TexBitmap node. Of course, in here we need to scroll down until we can see our File Slot here. We just click on the swatch, and if we just navigate to our exercise files, you'll see there is a Texture Files folder in there also.
And if we just scroll down, you can see we have a Water Displacement image. Just left-mouse- click to select that and we've now added that image as a displacement map, not that we're quite finished in our Texture Editing yet though. We do need to be aware that the Gamma Options we choose for our incoming bitmap will affect how displacement works in our scene. If for instance, we have a map that has come from an image editing application, such as Photoshop, there is a very high probability that the data in the image has already been gamma corrected.
To be more precise, it'll already have an sRGB color profile assigned to it, which is almost, but not exactly the same as a 2.2 gamma curve. So inside our Texture Editor options, if we leave this Color Space Value set at 0, V-Ray will use the image's built-in gamma or built in color profile. What I actually want to do with my incoming bitmap is really to use these controls to brighten it up a little bit. I want to even out the contrast and thereby flatten out any resulting displacement.
Now to do that, I need to set my Color Space option to a value of 1. This means now we can use this Gamma option to either increase or decrease the midtones in our image. In this instance I am going to set a value of 1.5, just to brighten up my incoming bitmap. If we want, we can of course use Preview Option just to take a quick render of the map and see how the grayscale values are working. As I'm quite happy with that, I'm just going to click OK to accept those changes. Back then in our Material Editor, in the Maps rollout of Pool Water Material, you'll notice down here at the bottom we have quite a number of controls for handling or dealing with the displacement that we are wanting to create.
One of the options in here is this Use Global setting. With these checked, we're essentially telling V-Ray to let the Global controls of displacement in V-Ray handle how this displacement mapping will work. With this option checked, V-Ray will always use its Global Settings to handle the displacement mapping that we're setting up here. Now if you're certain where the V-Ray's Global Displays controls are, if we just come up to our Options Editor, you'll see right down at the bottom we have a Displacement rollout.
These are V-Ray's global displacement controls. Now in this particular instance, we're not going to work with these settings, although you'll notice that they are pretty much the same as the ones housed in our Maps rollout. Instead, what I'm going to do is uncheck Use global and work with our local set of displacement controls instead. Working this way oftentimes can be very useful, especially if we have more than one displacement map in our scene. When we're using Displacement Materials, it's highly unlikely that we would want two different materials to use the same set of controls and have the same settings, so being able to work in a local sense can be very handy indeed.
Of course, because of the memory requirements associated with displacement mapping, it'd perhaps be unwise to have too many such materials on the go. Generally speaking, one or two is more than enough inside of a single SketchUp scene. Now straightaway, inside of my displacement setup, I want go and change my Displacement value to around about not 75, but around about .75. This value really tells V-Ray to either add to or subtract from the Displacement values already set up in our grayscale map.
Of course, using the Grayscale values, V-Ray will determine and measure an amount of displacement, and this multiplier can either add to or as we say, subtract from. So I'm just going to dial things back a little bit by setting a value of .75 in here. The thing I want to do is come down to my Edge Length parameter. In here, I'm going to set a value of 2. This option tells V-Ray the maximum length that any edge can have inside of our displaced mesh. Smaller numbers mean smaller edges, and smaller edges will give us a higher quality of displacement, but those come at the expense of much more geometry added into the scene at render time.
This naturally will slow down the rendering process, and it'll eat up more and more our system's memory resources. Generally speaking, we'll want to start testing with the default value of four and then slowly drop this value down in small increments, all the while comparing the quality of our displaced and result with the impact that we're having on our system's resources. A parameter that is tied to our Edge Length value is this View Dependent checkbox. View Dependent means that we're currently working in pixels.
If we uncheck this box, we'll be looking in scene units, which would obviously have quite a significant impact on how our displacement would turn out. So currently, we are setting a maximum edge length in our displacement of two pixels, which should work fine for our purposes. What we can do now then is take another test render and see whether or not our displacement is actually working for us, which of course it clearly is.
Now our water surface gives the impression of being disturbed by a surface wind or a surface breeze of some type, which in turn makes our reflections and our refractions so much more believable. So, although not something that we'd want to overuse in our scenes, due to the strain it puts on system resources--and we can very easily crash SketchUp if we're not careful-- we can see that selective use of displacement on objects that will benefit from it can go a long, long way towards adding to the final quality and realism of our V-Ray and SketchUp renders.