Saturday, January 25, 2014

Burning Ashes

Ashes! Ashes! We all fall down!

Inspiration

Typically in a high heat situation you see a lot of embers buzzing around. Sometimes if the material that is being lit is very light i.e. paper, leaves, volcanic ash, etc will take to the air before it's fully lit. I've made plenty of embers before but I wanted to try to replicate this effect in UDK. As an extra challenge I didn't want to allow myself to use alpha cutout plug.

Shader Overview


Entire Burning Particles Shader

Three Parts

I wanted to have a texture that was going to be slowly eaten away by heat. To me that meant having three parts to the texture. An unscathed portion that heat hasn't gotten to yet, a burning portion that is still hot, and finally a burned portion that has already burned off.

Burn Erosion

Burn Erosion Portion
Alpha Erosion typically makes materials transparent at different rates with less opaque parts fading out completely first. However, it still makes the entire material fade proportionally. This means that even places that haven't been burned yet would became less opaque. Not what I want.

My solution to this was using an if statement. If my [Texture Value - Opacty Value < Opacity Value] then those pixels were given an eroded (tex val - opacity val) value other wise the pixels were unchanged. It's a little confusing in the shader since i do a 1 minus operation to make both sides of my comparison increasing or decreasing at the same time. Without the one minus the if statement would always be false (Yes, this can be further cleaned up).

The rotator above is just to give some more randomness to the particles along with the standard contrast and brightness adjustments. I also added an inversion option at the end.

Colorizing

Color Mask
So that covers what pixels I decide to erode away. Some pixels will be zero i.e. fully transparent. Those values are fed into the opacity input. That leaves us with two parts left, the burning portion and unscathed portion.

I invert the output from my burn erosion to create a mask. Originally the parts that were completely opaque had a value of one but once I invert them they go to zero. This allows me to add in to those zero parts the value of my texture sample. I colorize the remainder of the mask by multiplying by my vertex color. This gives us our two remaining parts of the embers.

That other arrow you see going into a multiply is to make the burning portion flicker. It's a trick I learned from one of Bill Klidas's tutorials. It's a hack but gives you an easy way to make it appear as if the embers are flickering randomly

Flickering
Its basically adding sin and cos together then finding the abs value. Then I just threw in an add (that's set to .2) so that I could never have a value under .2. The time multiply at the end uses a dynamic parameter to change the flickering rate.

Friday, January 3, 2014

Demo Reel 2013

Demo Reel 2013



What have I been up to?

This reel has a compilation of everything I've done for about the last year that I wanted to show off. It has two different games that I worked on along with some random effects I worked on both real time and pre rendered. And in case you are wondering the music is Jelly Castle (Orchestral Mix) by MDK available free from creative commons.

Audio Wave

This is a game me and my friend Evan Li worked on for our game design class. He did all the game play programming while I worked on the effects and artwork. It's a music based game where you have to click the hexagons in rhythm to the music. Originally the mesh moved much like dropping something into water. but after some playing around it didn't really have the right look or feel. So instead I opted to use the normal information provided originally to sample a ramp texture.

Rule the Tides

This is what I worked on for my last and final semester at The Entertainment Technology Center. I had to split my time between doing game play and UI programming as well as doing effects. The VFX had to be optimized to work on Ipad so instead of using fancy shaders to do the work dynamically I prototyped most of the materials in UDK or Maya then used Maya, After Effects, and Photoshop to create flip books. I had a lot less dynamic variation this way but since most of the effects took place far away color blocking was more important than fine detail.