字幕表 動画を再生する 英語字幕をプリント Hi there and welcome to the Maya Learning Channel. Previously in this series, I showed you how to create realistic waves, shaders, and wakes using a combination of BOSS and Bifrost particles. In these appendices, I'll focus on some fun side effects - like simulating rain on a watery surface. As always, a big thanks to Diego Trazzi, on whose work these tutorials are based. So, while I'm going to start with a fresh scene here, I'm going to be using a very similar technique to the boat wake I created in part 3. That is, I'll first use geometry to generate real raindrop collisions on a wave solver, then cache the results to EXR files. I'll start by creating a polygon plane, and then adjusting its height and width to 60. I'll also add plenty of subdivisions, since I want to capture nice round ripples. Now, the easiest way to simulate rain is with nParticles, so I'll just create a new emitter. Then I'll change the Emitter Type to Volume and scale it to the size of the plane to create my cloud. Next, I'll translate my cloud above the plane, but too high. No need to waste time waiting for the particles to fall very far. And now that should be enough to get some rain. Nice. So since the droplets don't fall very far, I should limit their lifespan to 1 second so they don't fall forever. I can then adjust the amount of rain by changing the Emitter's emission Rate. For a light drizzle, I'll bump the value down to 20. Cool, now I need to prepare the mesh. I'll start by opening the BOSS editor and creating a Wave Solver for the mesh. Now, based on previous tutorials, you might try to add the raindrops as influencers. But you can't! As you can see, nparticles aren't compatible with BOSS. Instead, I'm going to have to generate some geometry around each particle first. So with my nParticle object selected, I'll go to Modify > Convert > nParticle to Polygons. Unfortunately, that seems to have temporarily removed my drops. To bring them back, I'll go to the nParticleShape's Output Mesh section and turn down the Threshold value. This reduces the smoothness requirement for generating meshes, thereby making them easier to generate. Now I get these blobs on each particle but they're kinda big, so I'll just reduce the Blobby Radius Scale. That's better. Of course, they still don't really look like raindrops but that's okay. I'm only interested in the collisions they make with the surface. Which I can now do by adding them as a Wave Influence. Now if I play back the scene, I get ripples where the drops hit the surface. I'll just make them more obvious by bumping up the Amplitude value. Once I'm happy with the effect, I can cache everything out. This creates two cache files in our cache folder. One for the Wave Influence, which records where the raindrops impact the water... ...and one for the Wave Solver, which records actual ripple deformation. These allow me to remove the nparticles from my scene, without losing my ripple effect. Now this looks kind of cool on its own, but it's still only on a flat plane. Even if I added an Arnold shader to it, we wouldn't get something very compelling. However, what if we combined it with our finished ocean from part 2? Remember, this is the scene where we projected the spectral waves onto a shader. I'll start by hiding the result plane and showing the BossOutput mesh again. In the BOSS Editor, I'll add a Wave Solver like before. I can also disable these Spectral Wave Solvers since I know the Arnold shader covers them. Now, instead of redoing my entire process from before, I can actually re-use the rain cache we already created and apply it to this new ocean! This time, rather than a Geometry Influence, I'll create an EXR Influence. As you probably guessed, this substitutes EXR files for geometry. I'll just click this file icon, and navigate to the cache we created previously. Make sure you select the BossGeoProperties cache, NOT the BossWaveSolver cache. Remember, this is the cache that recorded where the raindrops hit the mesh. I just need to adjust the file path. First, I'll replace the specific frame number with this generic frame tag, since I want use all the EXR files. I'll also add a project tag to the beginning, just to indicate that the files are local to my current project. And like before, I'll bump up the Amplitude. As well as turn off Collider, since the EXRs are just for the ripples. Now play back the scene, and you'll see the same rain pattern as our previous scene! But in here I can also apply my Arnold shader with all of its spectral wave displacements. Thereby combining my two effects into one! This'll be even more apparent if I cache the Wave Solver and render the entire sequence. I should note that even though I generated this EXR cache by “doing it for real” with the whole nParticle rain simulation, you don't have to go that route. If you prefer to create your rain pattern in a 2D compositor or by some other means, it'll work just as well! Speaking of EXRs, we can also use a compositor to define where we DON'T want ripples to show up. So, suppose our water was inside some kind of shelter with a circular hole in the roof. We would only want ripples in the non-roofed areas, right? I can achieve that using an EXR collider, where red denotes where ripples are allowed. Then I can apply it as a second EXR influence. This time, I only want the Collider. And sure enough, the ripples only appear in my red circle. By default, the boundary of this area is pretty hard, but I can soften it using the Wave Solver's Decay Width. Increasing this value widens the area of decay from the center of the sim to the boundary. And as you can see, it gives us a much more natural falloff. And that's a wrap for rain. But if these type of collision tricks interest you, be sure to check out my next video where I'll use them in shallow water to generate capillary waves.