All About Sprites
|
Sprites are flat, square shapes that always point towards the camera. These are the two most important things to remember about them. Why? Two reasons:
This means that you can use sprites to stamp an image across the scene. Before you say, "I can do that in Photoshop," remember that a particle figure exists in 3D. Not only can you stamp the image across the scene, but you can stamp the image through the scene. The particle figure's depth gives you a canvas to paint on, when you're using sprites. Sprites are commonly used for particle engines in realtime 3D applications, like games, because they're easier on system resources than real volumetric effects, but can still look very convincing. |
Approaching Sprites
Let's take a look at three different approaches to making a sprite-based particle figure:
Shroud of Madness
The "Shroud of Madness" preset that comes with Particles 3 is a good place to start the discussion. It shows a very basic usage of sprites: to create an affect that appears volumetric (like a gas or clouds).
If you look at the material settings for Shroud of Madness, you'll see that it's just ambient color and a transparency map. Each sprite uses the same map, but by varying their size, rotation and placement, the effect appears as a churning gas rather than as a repeated image.
The best part is that the effect has depth to it--you can put a figure inside.
Falling Sand
The "Falling Sand" preset showcases some important Material Room considerations with sprites.
If you look at the image map used for transparency, you'll see that it's just a white circle blended onto a black background. Its chief function is to make the edges of the sprites transparent, and the different sprites blend seamlessly with one another.
When you're making your own transparency maps for sprites, you need to keep in mind that every sprite has four hard edges - it is a square, after all. You'll almost always want to fade the edges or make sure that the shape doesn't extend to the edges of the map so that you don't end up with any hard edges within the effect when you render.
When you're working with procedural materials (using the Material Room to create different patterns), it becomes important to make sure that the edges are accounted for. With 3D shapes, like spheres, you can use the Edge_Blend node to fuzz edges. But sprites are 2D shapes - Edge_Blend won't work. Multiplying your procedural effect through the map used by Falling Sand (Runtime/Textures/ParticleMaps/gradient.jpg) is the easiest way to ensure smooth edges.
Cursed Magic
"Cursed Magic" is one of my favorite effects for Particles 3, and it shows off a very cool sprite trick.
You can use multiple transparency maps for your sprites in combination with the Particles 3 "Color-By-Life" and "Color-By-Random" setups. By plugging a different map into each slot of the ColorRamp, you not only get more variation in the sprites, but get blending from one map to the next.
For example, with a Color-By-Random setup, you could plug several different cloudy transparency maps into the ColorRamp. Every sprite would use a different blend of the maps, and your cloud would be more detailed and less repetitive than it would be otherwise.
With a Color-By-Life setup, the sprite will change maps as it ages/moves. Cursed Magic uses one of these setups. The sprite starts as a small pinprick of light, bursts, spirals and fades away to black. Using a Color-By-Life setup with sprites is a great way to control how each stage of your effect looks.
For more info on Color-By-Life and Color-By-Random, check out Getting Started: Materials.
Sprite Weaknesses
Sprites are very cool - but they're not for every situation. Here are some of the most common problems you'll encounter with sprites:
-
Specularity
Because sprites are flat, the surface of the sprite is all at one angle, and the sprite will get a uniform specular color/value. Having a flat square of color overlay your sprite is a fast way to ruin the volumetric and painterly effects that sprites otherwise provide. It's generally best to avoid using specularity with your sprites.
-
Displacement
Displacement causes the surface of objects to elevate, but sprites are always flat when facing the camera. Displacement takes extra render time to calculate, and there's almost never a benefit to pushing points directly towards the camera. Use Bump mapping instead, if you want to add some depth to your sprites.
-
Hard-line Intersections with Objects
When a sprite intersects directly with an object, you may get a hard edge along the intersection. The best way around this is to move the offending sprite slightly, so that it no longer intersects with the object.