Name QCOM_framebuffer_foveated Name Strings GL_QCOM_framebuffer_foveated Contributors Skyler Saleh Maurice Ribble Tate Hornbeck Jonathan Wicks Robert VanReenen Contact Jeff Leger - jleger 'at' qti.qualcomm.com Status Complete Version Last Modified Date: May 10, 2017 Revision: #11 Number OpenGL ES Extension #273 Dependencies OpenGL ES 2.0 is required. This extension is written against OpenGL ES 3.2. Overview Foveated rendering is a technique that aims to reduce fragment processing workload and bandwidth by reducing the average resolution of a framebuffer. Perceived image quality is kept high by leaving the focal point of rendering at full resolution. It exists in two major forms: - Static foveated(lens matched) rendering: where the gaze point is fixed with a large fovea region and designed to match up with the lens characteristics. - Eye-tracked foveated rendering: where the gaze point is continuously tracked by a sensor to allow a smaller fovea region (further reducing average resolution) Traditionally foveated rendering involves breaking a framebuffer's area into smaller regions such as bins, tiles, viewports, or layers which are rendered to individually. Each of these regions has the geometry projected or scaled differently so that the net resolution of these layers is less than the original framebuffer's resolution. When these regions are mapped back to the original framebuffer, they create a rendered result with decreased quality as pixels get further from the focal point. Foveated rendering is currently achieved by large modifications to an applications render pipelines to manually implement the required geometry amplifications, blits, and projection changes. This presents a large implementation cost to an application developer and is generally inefficient as it can not make use of a platforms unique hardware features or optimized software paths. This extension aims to address these problems by exposing foveated rendering in an explicit and vendor neutral way, and by providing an interface with minimal changes to how an application specifies its framebuffer. New Tokens Allowed in the config input in FramebufferFoveationConfigQCOM: FOVEATION_ENABLE_BIT_QCOM 0x1 FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 New Procedures and Functions void FramebufferFoveationConfigQCOM(uint fbo, uint numLayers, uint focalPointsPerLayer, uint requestedFeatures, uint *providedFeatures); void FramebufferFoveationParametersQCOM(uint fbo, uint layer, uint focalPoint, float focalX, float focalY, float gainX, float gainY, float foveaArea); Additions to Chapter 9 of the OpenGL ES 3.2 Specification The command void FramebufferFoveationConfigQCOM( uint fbo, uint numLayers, uint focalPointsPerLayer, uint requestedFeatures, uint *providedFeatures); is used to configure foveated rendering for the framebuffer object 'fbo' and to instruct the implementation to allocate any additional intermediate resources needed for foveated rendering. In order to enable foveation, this call must be issued prior to any operation which causes data to be written to a framebuffer attachment. Once this call is made for a framebuffer object, the fbo will remain a "foveated fbo". The following scenarios are unsupported conditions: 1. Rendering to a non foveated fbo, then calling FramebufferFoveationConfigQCOM results in current framebuffer content becoming undefined. 2. Rendering to a foveated fbo then switching attachments results in an error. Each layer of a foveated framebuffer, the max of which is specified by 'numLayers', can have multiple focal points as controlled by 'focalPointsPerLayer'. This enables applications that make use of double wide rendering to utilize foveated rendering and also allows more complex falloff characteristics to be modeled with multiple overlapping focal points. There are limitations to the number of focal points that an implementation can support with different enabled features or framebuffer formats. When an implementation can not support having as many focal points per layer as was specified in this function, it will fail with the error INVALID_VALUE. It is recommended that an application utilize as few focal points per layer as possible. The 'requestedFeatures' bitfield is used to specify which features an application would like to use. An explanation of each of the features is below: FOVEATION_ENABLE_BIT_QCOM: Is used to enable foveated rendering, if this bit is not specified foveated rendering will not be used. FOVEATION_SCALED_BIN_METHOD_BIT_QCOM: Requests that the implementation perform foveated rendering by dividing the framebuffer into a grid of subregions. Each subregions will be greater than or equal to one pixel and less than or equal to the full framebuffer. Then rendering the geometry to each of these regions with a different projection or scale. Then, finally upscaling the subregion to the native full resolution framebuffer. Quality in the scaled bin method is defined as a minimum pixel density which is the ratio of the resolution rendered compared to the native framebuffer. In the future it is expected that more features will be added, without breaking backwards compatibility. 'providedFeatures' is a pointer to a uint that will be set to a new bitfield that tells the application which features the implementation provided for the current foveation configuration, in the same format as used in the 'requested Features' bitfield. This may include more or fewer features than the application requested. The FOVEATION_ENABLE_BIT_QCOM will not be included if the implementation has to fallback to non-foveated rendering. If an application tries to make use of a feature that is not included in the 'providedFeatures' bitfield, the results of the operation are implementation defined, but should not yield application termination. If this command is called with 'requestedFeatures' equal to zero, then the value of 'providedFeatures' will have FOVEATION_ENABLE_BIT_QCOM unset, and the other bits will be set or unset to indicate which foveation features are supported by the implementation. The command void FramebufferFoveationParametersQCOM(uint fbo,uint layer, uint focalPoint, float focalX, float focalY, float gainX, float gainY, float foveaArea); is used to control the falloff of the foveated rendering of 'focalPoint' for layer 'layer' in the framebuffer object 'fbo'. Multiple focal points per layer are provided to enable foveated rendering when different regions of a framebuffer represent different views, such as with double wide rendering. Values of 0 to the framebuffers focalPointsPerLayer-1 are valid for the 'focalPoint' input and specify which focal point's data to update for the layer. 'focalX' and 'focalY' is used to specify the x and y coordinate of the focal point of the foveated framebuffer in normalized device coordinates. 'gainX' and 'gainY' are used to control how quickly the quality falls off as you get further away from the focal point in each axis. The larger these values are the faster the quality degrades. 'foveaArea' is used to control the minimum size of the fovea region, the area before the quality starts to fall off. These parameters should be modified to match the lens characteristics. For the scaled bin method, these parameters define the minimum pixel density allowed for a given focal point at the location (px,py) on a framebuffer layer in NDC as: min_pixel_density=0.; for(int i=0;i