top of page
Search
  • Writer's picture1/4" Jack Of All Trades

Computational Environments Week 7: O.U.O 12c - An Exercise in Unity Lighting and Post Processing

Updated: Apr 27, 2021

----------------> Video Link <----------------

I know it was meant to be a silent exercise in lighting but I couldn't help myself

(you could always mute it!)



Object of Uncertain Origin 12c

 

Made the scene using only simple geometry (mostly cubes and one sphere) and the built in Unity tree generator. The only external package used was the FMOD-Unity integration package to add some basic sound layers. Foliage movement achieved with a Unity wind zone.



Lights and Textures:


Original plan was to build a lighting rig that could put on a light show, moving and rotating spot lights; however moving lights created some bizarre interactions with the textured walls Cornell box, which jumped into view quite abruptly and ruined the immersivity of the experience. I fixed this by increasing the fog and going down to just a single spot light (the side lights of the rig are done with emissive materials instead).


Textures used are all of fractal patterns sourced online, I then used them to create normal maps to further improve the surface's reaction to lighting.



Post Processing:


At first tried to make it an underwater scene (inspired by the movement of the foliage in the wind zone), but when I began experimenting with different colour grading settings I found that changing the hue shift generated visually interesting results. In previous Unity project Simulacra I had used post processing volumes to change camera settings in different parts of the map, but had not attempted real-time modulation before (code snippet at the bottom). After successfully implementing the hue shift modulation I began experimenting with other post processing parameters that could potentially yield interesting results when modulated. In the end I added one further modulation to the intensity of the lens distortion. The combination of the two modulated post processing parameters gave the scene a more psychedelic feel, whilst retaining the underwater look. This, combined with the presence of the scanner, subjectively gives the work a sinister, otherworldly feel. In this regard, I wanted to interfere with the idea of the observer and the observed; give the cynosure an obfuscated purpose and a sense of mystery and power.



Audio & FMOD:


Made the sound using a variety of soft synths and recordings in Ableton, and then used Adobe Audition to create seamless loops for use in FMOD. Overall: 4 drones for the hue shift modulation, 2 drones for the overhead scanner and a final 'breathing' drone that I tried to time to the modulation of the lens distortion.

Used volume automation to create crossfades between the different drone layers and linked the FMOD parameter to the modulation of the colour grading hue shift to forge an audio-visual weld between the two. Added chorus and flanger to the main event output and interpolated between the two effects according to the progress of the lens distortion modulation.


Above: Parameter controlled volume automation.

Below: Parameter controlled effects automation.

 
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class PostProMod : MonoBehaviour
{
    [SerializeField] [FMODUnity.EventRef] private string fmodEventPath;
    [SerializeField] [FMODUnity.EventRef] private string fmodEventPath2;
    public float speed;
    public float gain;
    public float distSpeed;
    public float distGain;
    
    //pvt variables
    PostProcessVolume m_Volume;
    ColorGrading m_cShift;
    LensDistortion m_lDist;
    float cShiftMod;
    float dShiftMod;
    FMOD.Studio.EventInstance fmodEvent;
    FMOD.Studio.EventInstance fmodEvent2;


    void Start()
    {
        m_cShift = ScriptableObject.CreateInstance<ColorGrading>();
        m_cShift.enabled.Override(true);
        m_cShift.hueShift.Override(-2f);
        m_lDist = ScriptableObject.CreateInstance<LensDistortion>();
        m_lDist.enabled.Override(true);
        m_lDist.intensity.Override(-2f);

        m_Volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, m_cShift, m_lDist);
        fmodEvent = FMODUnity.RuntimeManager.CreateInstance(fmodEventPath);
        fmodEvent2 = FMODUnity.RuntimeManager.CreateInstance(fmodEventPath2);
        fmodEvent.start();
        fmodEvent.release();
        fmodEvent2.start();
        fmodEvent2.release();
    }

    void Update()
    {
        cShiftMod = Mathf.Sin(Time.realtimeSinceStartup * speed) * gain;
        dShiftMod = Mathf.Cos(Time.realtimeSinceStartup * distSpeed) * distGain;
        fmodEvent.setParameterByName("HueShifter", cShiftMod);
        fmodEvent.setParameterByName("LensDist", dShiftMod);
        m_cShift.hueShift.value = cShiftMod;
        m_lDist.intensity.value = dShiftMod;
    }

    void OnDestroy()
    {
        RuntimeUtilities.DestroyVolume(m_Volume, true, true);
    }
}

30 views0 comments
bottom of page