Skip to main content
Up and Coming
September 5, 2018

Oculus Asymmetric FOV and Unity Post Processing Stack V2

Oi Oi all,

Has anyone got Oculus Asymmetric FOV working with Post Processing Stack V2 in Unity ?, it dosn't seem to support it at all :

https://developer.oculus.com/blog/tech-note-asymmetric-field-of-view-faq/

Code from the uber stack does not have either eye detection or ProjectionMatrix for VR :

#if VIGNETTE
           {
               UNITY_BRANCH
               if (_Vignette_Mode < 0.5)
               {
                   half2 d = abs(uvDistorted - _Vignette_Center) * _Vignette_Settings.x;
                   d.x *= lerp(1.0, _ScreenParams.x / _ScreenParams.y, _Vignette_Settings.w);
                   d = pow(saturate(d), _Vignette_Settings.z); // Roundness
                   half vfactor = pow(saturate(1.0 - dot(d, d)), _Vignette_Settings.y);
                   color.rgb *= lerp(_Vignette_Color, (1.0).xxx, vfactor);
                   color.a = lerp(1.0, color.a, vfactor);
               }
               else
               {
                   half vfactor = SAMPLE_TEXTURE2D(_Vignette_Mask, sampler_Vignette_Mask, uvDistorted).a;

                   #if !UNITY_COLORSPACE_GAMMA
                   {
                       vfactor = SRGBToLinear(vfactor);
                   }
                   #endif

                   half3 new_color = color.rgb * lerp(_Vignette_Color, (1.0).xxx, vfactor);
                   color.rgb = lerp(color.rgb, new_color, _Vignette_Opacity);
                   color.a = lerp(1.0, color.a, vfactor);
               }
           }
           #endif

Does anyone have a fix/hack or can help ?
    This topic has been closed for replies.

    1 reply

    JHibbinsAuthor
    Up and Coming
    September 5, 2018
    More info : I can adjust the centre in the FOV but not for each eye independently, I’ve looked at the unity post processing source ( https://github.com/Unity-Technologies/PostProcessing )
    And can see in this file : https://github.com/Unity-Technologies/PostProcessing/blob/v2/PostProcessing/Shaders/Builtins/Uber.shader lines 170 to 175 that no adjustment for asymmetric-field-of-view are being done for VR
    Windlands 2, Windlands and Crystal Rift Twitter: @hibbins Home: http://www.psytecgames.com/