Showing results for 
Search instead for 
Did you mean: 

Fade screen to black by (ab)usinging the ovrLayer system / compositor.


Looking at the Mobile SDK headers, ovrSubmitFrameDescription2 that gets passed to vrapi_SubmitFrame2

supports multiple layers.


typedef struct ovrSubmitFrameDescription2_ {
... // hidden other struct members for brevity.
uint32_t LayerCount;
const ovrLayerHeader2* const* Layers;
} ovrSubmitFrameDescription2;



And the ovrLayerHeader2 struct seems to support blending between layers and you have ColorScale.a to control that blend.



typedef struct ovrLayerHeader2_ {
    ...                           //Again I'm only showing the relevent struct members
    ovrVector4f ColorScale;
    ovrFrameLayerBlend SrcBlend;
    ovrFrameLayerBlend DstBlend;
} ovrLayerHeader2;



It seems that it might be possible to use this system to fade the screen to black (or any other color really) during say teleporting, instead of doing it as a post process or shader epilogue.  Seeing as the compositor is already processing images in the submitted layers, if it is possible it seems like it might be a fair bit more performant doing it this way. 


I tried with my swapchain textures and an additional layer similar to the one returned by  vrapi_DefaultLayerBlackProjection2 but couldn't get it to work, so I'm wondering if anyone else has tried it and whether you had any success?


I'm doing Native Quest development so really asking about that, but it seems like it could benefit people using Unity or UE4 as well?