I really wasn’t sure what to call this Unity3D post processing effect, but it’s a pretty nice one that creates a splash of liquid across the screen. It could be used in racing game when driving through a puddle, a boating game at any time, change the color to red and you’ve got a nice blood or lava splash, or easily modify it to have liquid dripping down the screen for rainy scenes, etc. etc. Just to have an idea of what I’m talking about, you can check out a WebGL example here – just click on the Unity scene to trigger the effect. If it seems useful, I’ll try to describe it below. The effect starts with a particle system, so we’ll create that first. Start with a circular texture (say, 128×128) with a red/green normal map. Feel free to use the one here for simplicity’s sake. I know it looks pretty weird, but we’ll use those colors later to create a faky refraction effect you typically find in water drops. Create a new material using an alpha blended particle shader and set that texture as the material’s particle texture. In your Unity scene create a particle system using […]
Read More

Here’s a quick little tip/idea to demonstrate using custom vertex streams and custom data in your Unity3D Particle Systems to create some pretty interesting VFX such as dissolving particles. Doing some googling, there didn’t seem to be a lot of information out there about custom data in particle systems, so hopefully this will help out a little. From a high level, what this entails is creating a particle system that will automatically send some data to the shader of the particle material via the shader’s vertex stream. So, as you might guess, the first thing we’ll need is a shader that will be able to handle the data sent. Even sooner, though, let’s get a couple textures together. For the particle we can just use a basic particle png that has a radial gradient that goes from white in the center to full full alpha along the outer edge. We’ll also need a dissolve texture, which in this case can just be some quick perlin noise. You can make both in Photoshop or Gimp in about 5 minutes or just nab them here if you’d like to just try this out quickly. Of course, since the effect we’ll be looking […]
Read More

So, the other day at work we were exploring various methods of adding nice lighting effects to a Unity scene without actually using real time lighting (in order to maintain the best possible performance on low end mobile devices). I took this to be the perfect opportunity to learn Unity’s new Shader Graph. If you’re not familiar, Shader Graph is Unity’s new node based visual shader editor. Currently, it only works with one of Unity’s new render pipelines (lightweight or HD), so if you’d like to try it out and haven’t yet, be sure to set up a project appropriately using Unity Hub or the package manager. Once I got the project set up, I thought I’d look at using shader graph to create fake specular lighting and thought I’d share what I discovered. First, specular lighting is not all that complex or involved which is why I thought it’d be pretty well suited for lightweight fake lighting. If you do a quick google search (as I did), you’ll see specular highlighting basically boils down to the following formulae. The reflected direction, R, is calculated like this: R = 2N(N·L)-L where N is the normalized world normal of the reflecting […]
Read More

So here’s a small thing that may help some folks out. Ages ago, while researching how Photoshop blend modes work behind the scenes, I stumbled across this fantastic demo on Shadertoy and have kept it bookmarked since. Recently, I wanted to do some overlay blending in Unity, so went back to the Shadertoy example and did a quick port to the .cginc file below: [crayon-5d7e14aad0160921032770/] Usage should be fairly self explanatory, but here’s a quick Overlay shader example: [crayon-5d7e14aad0168081360630/] Using these two images (which I just happened to find in my Dropbox directory so I’m claiming ownership) can produce all the effects in the picture at the top of this page (left-to-right top-to-bottom: Add, ColorBurn, ColorDodge, DarkerColor, Difference, Divide, Exclusion, HardLight, HardMix, Lighten, LighterColor, LinearBurn, LinearDodge, LinearLight, Overlay, PinLight, Screen, SoftLight, Subtract, and VividLight). I left off the blends Hue, Color, Saturation, and Luminosity simply because they were a little more expensive and I wasn’t interested at the time. Feel free to add them back in – easy enough to do. Enjoy. Edit: Just for the sake of completion, I’ve added the Hue, Color, Saturation, and Luminosity blend modes. Keep in mind, to simplify usage of these, you may […]
Read More

Here’s just a quick little personal project I was playing around with. I’ve seen a bajillion portal projects for augmented reality (possibly the best being this Aha demo), but I wanted to add my own little Rick and Morty twist to one. The portal uses ARCore motion tracking to open or close according to the user’s proximity. Some models used: Pickle Rick Mr. Meeseeks Portal Gun Incidentally, ARCore 1.2 has just been released. Looks like some cool new features to start digging into.
Read More