Holographic foil card effect

Earlier this week I saw a really neat effect where @Sererena simulated the view-dependent shimmering of a foil card, fed by a smartphone accelerometer.  This seemed like a good challenge to improve my material creation skills in UE4, so I gave it a go yesterday and came up with something I’m reasonably happy with. The view angle is controlled by WASD rather than the accelerometer since I was more focused on the material.


You can download the assets and test project (built with Unreal Engine 4.15), licensed as CC0.


The material has 8 layers:

  • Background
  • Distant large stars
  • Small stars / motes
  • Near large stars
  • Character foil outline
  • Character
  • Foil on character accents
  • Card border
Outline of foil card material (M_FoilCard) showing the various layers

The foil character accent layer and the star layers all parallax as the view angle changes (shift around, with a larger shift for nearer layers, faking a sense of depth).

The foil layers (everything except the character) are colored by a lookup into a ‘holographic plate’ texture, using an ad hoc function of the tex coord, distance, and tilt amount.

The character accents layer is done with a color notch filter and one star layer, directly added to the character color (rather than lerping to it). This is the part I’m least happy with in the current implementation, but I’d need to test it with a real character to see exactly what I’d want to change.

The material is built using a bunch of material functions as building blocks to make it cleaner, but these aren’t meant to ‘stand alone’; there are lots of assumptions built into them about textures and parameter values.

I’m using a live capture of a 3D character instead of a 2D base, but after the capture Blueprint updates the render target, everything else is the same either way. The capture BP is an opaque box containing the character, a capture component, and a controlled light source.  Even with setting the capture component to only capture the self actor and setting an aggressive culling distance, some ‘global’ things like atmospheric fog still render into it, so I had to use the mode that gave me depth in alpha rather than an opacity mask in order to discard it.

The outline is done with a Sobel edge detection filter on the thresholded depth from the character render target (which has depth as alpha). Rather than using a kernel of the adjacent texels, it uses texels 8 away to increase the width of the outline. If I were using 2D characters I’d probably skip the runtime Sobel filter and do that offline once into a mask texture.

Planetary Garden

Ludum Dare 38:

For one reason or another I’ve never managed to participate in a Ludum Dare before this past weekend (LD 38). Planetary Garden was made under the compo rules (worked alone, created all new assets, finished within 48 hours of starting). However, I got a late start (3 PM Sat) and did not submit in time for the official deadline, so it’s technically a jam entry.

The theme was “a small world”, and I started riffing on various ideas for many connected small worlds: perhaps a platformer on a circular planet or mini golf where you switch worlds.  These ideas didn’t quite jell or seemed out of scope considering compo rules, and incremental games have been on my mind as well, so I ended up going in that direction (tho Planetary Golf seems like it has legs, might revisit it in the future).

You can download the compiled version for Windows as well as the project with source code and assets at itch.io, and vote / leave feedback on the LD 38 project page. Unless otherwise noted, assets created for the compo are placed under a CC0 license and game code under a MIT license.

Art Style:

Entering the compo means that you have to make all of your own art and audio (with some very limited exceptions for fonts and brushes/samples, etc… that are suitably transformed). I’m not a particularly good artist, so I went with a watercolor artistic style that let me leverage materials for most of the impact, and created the actual art as simple RGB masks (outer border, inner border/outline, and fill color). I wasn’t going for realism but just something evocative of watercolors, with variations in opacity and splotichiness generated by a couple of noise samples operating in screen space so it looks coherent across objects.

How to play:

  • Repopulate a barren planet (Earth?) with life by seeding new plants
  • When the time is right, enlist animals to help automate the process (one of them knows an ancient secret).
  • Eventually other things happen. No spoilers.
  • Note: Progress is saved between sessions, but time does not advance while the application is closed. Keep it open to continue amassing life.