webgl-dom-page

Map DOM elements to WebGL planes with texture loading and cover UV scaling.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/BamoJ/playfight-2k26 --skill webgl-dom-page
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webgl-dom-page
Source: https://github.com/BamoJ/playfight-2k26/tree/main/.claude/skills/webgl-dom-page
Command: npx skills add https://github.com/BamoJ/playfight-2k26 --skill webgl-dom-page

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust pattern for creating WebGL-enhanced web pages where 2D DOM elements are seamlessly integrated with 3D WebGL planes, offering advanced visual effects and interactions.

Core Features & Use Cases

  • DOM-to-WebGL Mapping: Renders DOM elements as WebGL planes with accurate sizing and positioning.
  • Texture Loading & Management: Handles image loading, deduplication, and synchronization with DOM elements.
  • Cover UV Scaling: Replicates CSS object-fit: cover behavior within the WebGL shader.
  • Portal Pattern: Solves issues with position: fixed elements within transformed containers.
  • Use Case: Building a portfolio website where product images are displayed as interactive WebGL planes that respond to scroll and hover effects, while maintaining a smooth transition between pages.

Quick Start

Use the webgl-dom-page skill to create a new WebGL page that maps DOM elements to WebGL planes.

Frequently Asked Questions about webgl-dom-page

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

FAQPage Schema
How do I map DOM elements to WebGL planes in three.js?

Mapping DOM elements to WebGL planes involves rendering 2D elements as 3D objects with accurate sizing and positioning. This pattern manages texture loading synchronization and cover UV scaling to replicate CSS object-fit behavior within shaders.

Why do position fixed elements break inside transformed containers in WebGL?

Position fixed elements break because transformed containers create new containing blocks. The portal pattern solves this by managing fixed elements within transformed containers, ensuring correct visual positioning during WebGL interactions.

How do I handle CORS and image loading synchronization for WebGL textures?

Handling WebGL texture loading requires managing CORS restrictions and synchronizing DOM image visibility. This pattern ensures correct DOM image visibility for accurate rendering and handles image loading deduplication.

Can I replicate CSS object-fit cover behavior inside a WebGL shader?

Replicating CSS object-fit cover in WebGL shaders is achieved through cover UV scaling. This technique adjusts texture coordinates within the shader program to match the visual behavior of the CSS property.

What is the Page and View orchestrator pattern in WebGL page transitions?

The Page and View orchestrator pattern structures WebGL page transitions by managing texture loading, template scoping, and interaction layers. It ensures seamless synchronization between DOM elements and WebGL planes during navigation.

Do I need to manage template scoping when integrating WebGL with DOM elements?

Managing template scoping is necessary when integrating WebGL with DOM elements to ensure correct rendering contexts. This pattern handles template scoping to isolate visual layers and maintain accurate DOM image visibility.