Graphics Reference
In-Depth Information
Combined rendering. This example shows how an application can combine the use
of pixel local storage with a normal rendering pipeline.
1. Begin frame with normal rendering by just writing color to a user-defined
fragment shader output.
2. Call glEnable(GL_SHADER_PIXEL_LOCAL_STORAGE_EXT) .
3. Get the current framebuffer color by using the GL_ARM_shader_framebuffer
_fetch extension and store value in the pixel local storage.
4. Do more operations on the pixel local storage by rendering geometry, etc.
5. Resolve from the pixel local storage to a user-defined fragment shader out-
put.
6. Call glDisable(GL_SHADER_PIXEL_LOCAL_STORAGE_EXT) .
7. Continue rendering with shaders that write to one or more user-defined
fragment shader outputs. Render alpha-blended geometry, GUI, etc.
8. Call eglSwapbuffer .
3.3.5 Limitations
The extension has the following limitations:
When writing to pixel local storage, the value of the framebuffer pixel cov-
ered by that fragment becomes undefined.
When writing to any user-defined fragment output, the pixel local storage
values for that fragment become undefined.
Multiple render targets is not supported while pixel local storage is enabled.
Multisampling is not supported.
Blending is not supported.
3.4 Deferred Shading Example
Techniques such as deferred shading [Hargreaves and Harris 04] are typically
implemented using multiple render targets by rendering the required intermedi-
ate data and then sampling from this data using textures. While flexible, this
approach consumes a large amount of external memory bandwidth.
Since the deferred shading data is often only written to and read by shaders
executing on the same pixel position, the Shader Pixel Local Storage extension
can offer a more ecient alternative by keeping the data on-chip. This allows
Search WWH ::




Custom Search