AGSL-Playground

Introduction: Android Graphics Shading Language (AGSL) is used by Android 13 and above to define the behavior of programmable RuntimeShader objects. AGSL shares much of its syntax with GLSL fragment shaders, but works within the Android graphics rendering system to both customize painting within Canvas and filter View content.
More: Author   ReportBugs   
Tags:

Android Graphics Shading Language (AGSL) is used by Android 13 and above to define the behavior of programmable RuntimeShader objects. AGSL shares much of its syntax with GLSL fragment shaders, but works within the Android graphics rendering system to both customize painting within Canvas and filter View content.

Shaders are short programs that run on the graphics processing unit (GPU) and manipulate the appearance of pixels on the screen. AGSL is based on the Skia Shading Language (SkSL), which is also used by the Skia graphics engine that powers Android's rendering pipeline.

AGSL provides developers with a powerful and expressive way to create custom visual effects. With AGSL, developers can create effects such as:

  • Custom color filters: AGSL can be used to create custom color filters that change the overall appearance of images or video.
  • Gradient fills: AGSL can be used to create gradient fills that smoothly transition between multiple colors.
  • Animated effects: AGSL can be used to create animated effects that move and change over time.
  • Custom lighting and shadows: AGSL can be used to create custom lighting and shadows that add depth and realism to scenes.

AGSL is a very powerful tool that can be used to create a wide variety of visual effects. However, it is also a relatively new language, and there are still some limitations to what can be done with it. For example, AGSL does not yet support all of the features of SkSL, and it can be difficult to debug AGSL shaders.

Despite these limitations, AGSL is a promising new technology that has the potential to revolutionize the way Android applications are developed. Developers who are interested in creating custom visual effects should definitely explore AGSL.

Getting Started

  • Prerequisite: Android 13 (API 33) device
  • Clone and build the project
  • Explore the shaders and experiment with them in your own projects!

References

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools