power2d

Render GPU-accelerated 2D shapes with Babylon.js and WebGPU.

4|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/AvneeshSarwate/avTools --skill power2d
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: power2d
Source: https://github.com/AvneeshSarwate/avTools/tree/main/skills/power2d
Command: npx skills add https://github.com/AvneeshSarwate/avTools --skill power2d

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GPU-accelerated 2D rendering for web apps, enabling complex visuals with thousands of shapes using Babylon.js and WebGPU. It provides a pixel-space pipeline with shader-based coordinate transforms and supports code-generated materials for body and stroke rendering.

Core Features & Use Cases

  • GPU-accelerated styled shapes with optional stroke outlines and thin instancing for large scene counts.
  • Code-generated materials (body and stroke) that work with WebGL and WebGPU backends and enable high-performance rendering.
  • Pixel-space coordinates with a pixelToNDC shader transform; easy composition in 2D scenes; scene helpers like createPower2DScene and CanvasTexture for integration.
  • Use cases include interactive data visualizations, generative art, dashboards, and UI overlays requiring many shapes rendered efficiently.

Quick Start

Install and import the power2d library, initialize a 2D scene with createPower2DScene, create a StyledShape using CirclePts or RectPts, assign a generated material, and animate by updating transform properties (x, y, rotation) each frame.

Frequently Asked Questions about power2d

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render thousands of 2D shapes in real-time using Babylon.js?

To render thousands of 2D shapes in real-time using Babylon.js, utilize thin instancing and code-generated shader materials to minimize draw calls and maximize GPU throughput for high scene counts.

Does Babylon.js support WebGPU for GPU-accelerated 2D rendering?

Babylon.js supports WebGPU for GPU-accelerated 2D rendering by using code-generated materials that function across both WebGPU and WebGL backends to process pixel-space coordinate transforms efficiently.

What is the best way to create interactive 2D dashboards with WebGPU?

Creating interactive 2D dashboards with WebGPU is best achieved using a pixel-space rendering pipeline with shader-based coordinate transforms, allowing styled shapes to be animated and updated efficiently each frame.

How do I add stroke outlines to 2D shapes in a WebGPU scene?

You can add stroke outlines to 2D shapes in a WebGPU scene by assigning code-generated materials that explicitly support both body and stroke rendering, allowing optional outlines without sacrificing GPU performance.

Can I use pixel-space coordinates for 2D UI overlays in Babylon.js?

You can use pixel-space coordinates for 2D UI overlays in Babylon.js by applying a pixelToNDC shader transform that converts pixel values to normalized device coordinates, enabling accurate composition within 2D scenes.