spncryn/log

Menu

22122019

Implemented a new effect for the camera zoom, designed to somewhat emulate both in visuals and audio a quasi-focus shift effect in digital photography. It was pretty straightforward to implement in terms of the basic steps: I already had different zoom levels mapped so all I really did was increase the speed of the zoom factor, and added a mild chromatic shift + Gaussian blur effect after every zoom. For whatever reason it took me a while to figure out how to actually implement the effects – I spent an hour or two stupidly trying to combine the shaders themselves – but eventually I just ended up with a standard surface stack. 

Basically, how it works is that there’s three layers at work (only two of which are relevant for this): 

  1. SURF_CHROMA (the irrelevant one), which stores the application surface after the chromatic palette is drawn
  2. SURF_GLITCH, which applies a glitched-out filter over the chromatically-shifted SURF_CHROMA
  3. SURF_BLUR, which applies a basic Gaussian blur to the visually distorted SURF_GLITCH

Each one uses its own shader and draws the previous surface using the respective shader. It’s almost definitely incredibly inefficient and prone to performance issues so I’m monitoring it closely, but so far I’ve been able to address all the issues that’ve arisen heretofore.

All in all, I think the effect looks pretty good, if I could say so myself.

Leave a Reply

Your email address will not be published. Required fields are marked *