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
Objects rendered in a 3D application, to take on a genuine level of believability in a viewer's mind, they really do need to interact correctly with the environment around them. Adding real-world lighting effects such as caustics can oftentimes make all the difference in the world when it comes to creating a believable shot. In this video we're going to make use of photon mapping in V-Ray and show you how we can generate realistic caustic effects in our scenes. As the V-Ray sun is currently the key light in our scene, it is going to play an extremely important role in helping us create this particular effect.
Of course, one of the first things we need in our scene is a surface type and a material that we would expect caustics to be generated from. Typically, these would be refractive objects or materials. For our purposes, we're going to use the old chestnut of caustic demonstrations and work with our ornamental pool water. We already of course have the perfect material in place here, as we have our refractive water surface along with displacement mapping added to it. Now displacement mapping will be important in the generation of our caustic effects, really it is the displacement on our surface that will generate the caustic patterns for us.
It'll shape the caustic patterns, and a little bit later on, you'll see just how true that is. Let's start creating our caustic effect then by first of all going and turning on the Caustic systems in V-Ray. So let's open up our Options Editor, and down towards the bottom you'll see we've a Caustics rollout. To enable the system all we need to do is put a check in the On box. This now tells V-Ray that light objects in the scene need to be generating caustic photons. It probably is worth just highlighting here that V-Ray keeps the Caustic Photon and GI Photon systems completely separate; this affords us much greater control over each of these lighting elements.
Now even though we have enabled our caustic system, taking a test render at this time would reveal that we don't necessarily get any viewable caustic effects in the scene. First of all, we need to go and perform a little bit of a tweak to our V-Ray sun settings; we did say it would play a key role in the creation of this particular effect. So let's come up to our Environment rollout and we want to come into the Map Slot of our GI Color controls. In here you'll see we've this Sampling section inside our SunLight controls that basically handles the generation of caustic photons.
The value we initially need to tweak in here is this Photon Radius setting. This value sets an area in scene units inside of which caustic photons will be generated. Outside of that area, there will be no photons cast into the scene. This really helps save both time and memory. Of course, we need to set this value high enough so that our entire pool area is encompassed. In here then, I'm going to set a value of 600. Remember, this is working in SketchUp's scene units, which will be inches.
So with that tweak made, let's see if we actually get any caustics in our scene now. So let's take a test render. Very clearly, you can see that we do indeed have caustics being generated in our scene. If we look on the bottom of our pool, you can see these soft lighting patterns that are playing across the bottom of the pool. And you can see we are generating caustics from our glass butterfly, so we're getting two sets of caustics for the price of one here. Clearly though, what we have are not the typical sort of patterns that people expect from a caustic effect, so we really need to improve things a little bit here before we can call ourselves finished with this particular lighting effect.
Our first port of call then will be our sun controls, so let's go into our Options Editor, the Environment rollout, and into our GI color map slot, and let's again go to our Sampling controls. This time we want to alter the value in our Caustic Subdivs setting, so we're going to up this to a value of around about 6,000. That's quite a high setting. This essentially is quality controlled again for our caustic effect. Essentially what this setting does is really allow V-Ray to calculate more complex light paths; it'll use more caustic photons, essentially adding more detail to them.
So a value of 6000 should work very nicely there. We may also want to brighten our caustics up a little bit. Obviously, we have to be very careful with this, because we need to match the brightness of the caustics with the level of direct illumination that is visible in the sense. But if we up this to a value of about 1.2, that should just make our caustic effect stand out a little bit more clearly. So those are the settings we want to tweak on our V-Ray Sun. We do want to come back to our Caustic rollout and make a couple of changes in here, the first of which will be to decrease our Search Distance value.
I'm going to set this to something around about 5. We'll now get less averaging between photon samples in a scene. V-Ray will not look as far out in scene units in order to gather new photon samples that it will average across. This should have the effect of sharpening up our caustic patterns. Of course, if we want to blur our patterns, then increasing the Search Distance would do that for us. We also want to make a tiny tweak to our Max Photons. We'll set this to a value of 25. Again, we're now using less photons in the creation of each caustic pattern.
This again will have the effect of sharpening our caustics up. And once again, if we wanted to blur our caustic patterns, then increasing the Max Photons would probably do that for us. So with those changes made, let's once again go and take a render. What we have now of course is a much more typical caustic effect. These are the sort of patterns that people expect when you talk about adding caustic effects into a scene. Now of course, we can very clearly see that connection between our caustic patterns and the displacement map that we're using.
You can see that the bright spots in our caustic effect very much map to brighter spots in our displacement map. So if it is that we want a less noisy caustic effect, then certainly the type of displacement that we use would have a huge impact on that. Not that we need displacement in order to generate caustics; you can see we are getting some very interesting caustic patterns coming from our glass butterfly, and that of course has no displacement applied to it. We don't even have to have refractive materials; we did mention earlier on that a refractive material is typically one that would generate caustics, which it is.
But reflective materials can generate caustics just as easily. So metals, glass mirrors, those sorts of materials would definitely generate reflective, instead of refractive, caustics. In fact, if we just take a look at our poolside, you see, because of the reflective nature of our water material, we are some reflected caustics also. Keep in mind also that every scene will be different; the settings that we have used to generate our caustic effect will not necessarily work on projects of your own. You may need to be prepared to do a little bit of experimentation in order to find just the right mixture of settings that work for you.
Finding these extra little nuances to add into our scenes can most definitely go a long way towards our ultimate goal of producing high-quality unbelievable renders from the V-Ray engine.