SkillAgentSearch skills...

Agsl

No description available

Install / Use

/learn @tbahlai/Agsl
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AGSL Shaders in Jetpack Compose 🎨

This repository contains the source code for my ProAndroidDev article about exploring AGSL (Android Graphics Shading Language) within Jetpack Compose. It demonstrates how to implement complex mathematical fractals and dynamic backgrounds with high performance.

🚀 Overview

The project showcases three distinct types of shaders:

  • Mandelbrot Set: Focuses on coordinate mapping, zooming, and panning on the complex plane.
  • Interactive Julia Set: Demonstrates real-time user interaction by linking touch coordinates to shader parameters.
  • Animated Background: A practical UI application showing how to create smooth, animated gradients using shaders.

Mandelbrot Set

A classic fractal rendered using the escape-time algorithm.

Performance: Optimized using Modifier.drawWithCache and RuntimeShader caching. Interaction: Supports Pinch-to-Zoom and Panning via TransformableState. Note: Uses a multi-stage color palette for smooth aesthetic transitions.

<img src="screenshots/Mandelbrot-Set.gif" width="360" height="800" alt="Mandelbrot Set" />

Interactive Julia Set

Unlike Mandelbrot, the Julia set changes its entire shape based on a constant c.

Real-time Input: The c constant is mapped to the user's touch/drag position. Optimized Drawing: Static uniforms (colors, size) are separated from dynamic inputs (mouse position) to minimize GPU overhead.

<img src="screenshots/Julia-Set.gif" width="360" height="800" alt="Interactive Julia Set" />

Animated Background

A practical example of how shaders can replace heavy video backgrounds or complex drawable animations.

Algorithm: Combines multiple sine waves and a radial spotlight effect. Reusable Modifier: Implemented as a custom Modifier.animatedBackground() that can be easily dropped into any Compose project.

<img src="screenshots/Animated-Background.gif" width="360" height="800" alt="Animated Background" />

📖 Article

You can find the detailed walkthrough and explanation of this code on my ProAndroidDev profile.

⚙️ Requirements

Android 13 (API 33) or higher (Required for AGSL).

Jetpack Compose 1.4.0+.

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated1mo ago
Forks0

Languages

Kotlin

Security Score

65/100

Audited on Feb 17, 2026

No findings