LogoLogo
  • Home
  • Projects
  • About
  • Contact

Custom Post Processing with the LWRP

by Devon O.· September 15, 2019· in Shaders, Unity3D· 1 comments tags: lightweight rendering pipeline, LWRP, post-processing
About a week ago, someone posted a comment on this old post asking if I could update the ripple effect so that it would work with Unity’s Lightweight Render Pipeline and 2D lighting. This seemed like a good opportunity not only to familiarize myself with the LWRP and the post processing stack, but to clean up some pretty ugly and ancient code. The final result can be seen here. The red and yellow lights drifting around are point lights being reflected off a Sprite instance (i.e. 2D lighting). There is also a built in Unity Post Processing vignette effect added. And by clicking on the game screen, you can see the rubbery ripple effect which is a custom post effect similar to the one from the previous post. To create that effect, you have to start with setting up a project. I won’t bother to go over a lot of detail in project set up, but basically, you need to create a new project and, using the package manager, install the Lightweight RP package (this will automatically bring in the Core RP Library and Post Processing packages as well).  Create a Lightweight Render Pipeline asset and add it to your […]
Read More

Liquid On Screen Effect

by Devon O.· February 24, 2019· in Shaders, Unity3D· 0 comments tags: liquid
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

Dissolving Particles with Custom Vertex Streams

by Devon O.· February 03, 2019· in Shaders, Unity3D· 0 comments tags: particles
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

Fake Specular Highlights with Shader Graph

by Devon O.· December 27, 2018· in Shaders, Unity3D· 0 comments tags: fake lighting, shader graph, specular
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

Photoshop Blend Modes for Unity3D

by Devon O.· June 21, 2018· in Shaders, Unity3D· 0 comments
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-6046bab1676d5266384181/] Usage should be fairly self explanatory, but here’s a quick Overlay shader example: [crayon-6046bab1676d9485825373/] 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
  • 1
  • 2
  • 3
  • 4
Devon O. Wolfgang

AIR | Unity3D | AR/VR

Unity Certified Developer

Technical Reviewer of “The Essential Guide to Flash CS4 AIR Development” and “Starling Game Development Essentials”

Reviewer of “The Starling Handbook”

Unity Engineer at Touch Press.

Categories
  • Actionscript (95)
  • AIR (16)
  • Flash (99)
  • Games (7)
  • Liberty (13)
  • Life (53)
  • Shaders (20)
  • Unity3D (21)
Recent Comments
  • MainDepth on Unity Ripple or Shock Wave Effect
  • Devon O. on Unity Ripple or Shock Wave Effect
  • Feral_Pug on Unity Ripple or Shock Wave Effect
  • bavvireal on Unity3D Endless Runner Part I – Curved Worlds
  • Danielius Vargonas on Custom Post Processing with the LWRP
Archives
  • December 2020 (1)
  • December 2019 (1)
  • September 2019 (1)
  • February 2019 (2)
  • December 2018 (1)
  • July 2018 (1)
  • June 2018 (1)
  • May 2018 (2)
  • January 2018 (1)
  • December 2017 (2)
  • October 2017 (1)
  • September 2017 (2)
  • January 2017 (1)
  • July 2016 (1)
  • December 2015 (2)
  • March 2015 (1)
  • September 2014 (1)
  • January 2014 (1)
  • August 2013 (1)
  • July 2013 (1)
  • May 2013 (1)
  • March 2013 (2)
  • December 2012 (1)
  • November 2012 (1)
  • September 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (1)
  • December 2011 (2)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (1)
  • May 2011 (2)
  • April 2011 (2)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (3)
  • October 2010 (5)
  • September 2010 (1)
  • July 2010 (2)
  • May 2010 (5)
  • April 2010 (2)
  • March 2010 (7)
  • February 2010 (5)
  • January 2010 (5)
  • December 2009 (3)
  • November 2009 (1)
  • October 2009 (5)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (1)
  • June 2009 (2)
  • May 2009 (6)
  • April 2009 (4)
  • March 2009 (2)
  • February 2009 (4)
  • January 2009 (1)
  • December 2008 (5)
  • November 2008 (2)
  • September 2008 (1)
  • August 2008 (6)
  • July 2008 (6)
  • June 2008 (9)
  • May 2008 (4)
  • April 2008 (3)
  • March 2008 (4)
  • February 2008 (9)
  • January 2008 (7)
  • December 2007 (6)
Copyright © 2021 Devon O. Wolfgang