MCPcopy Index your code
hub / github.com/egorshest/webgl-ascii-hero

github.com/egorshest/webgl-ascii-hero @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
24 symbols 36 edges 9 files 1 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Next.js hero section with animated rotating object in ASCII style

A beautiful Next.js project boilerplate with a hero page WebGL demo featuring a 3D GLTF model rendered with React Three Fiber and post-processed into an animated ASCII art effect using custom shaders.

Features

  • Real-time ASCII conversion - Custom GLSL shader converts 3D scene to ASCII art
  • Interactive 3D model - Drag to rotate, hover to zoom
  • Post-processing effects - CRT-style scanlines, vignette, and glow effects
  • Mouse-reactive - Mouse position affects glow and visual effects
  • Responsive - Works on desktop and mobile devices

Tech Stack

Getting Started

Prerequisites

  • Node.js 18+
  • npm, yarn, pnpm, or bun

Installation

# Clone the repository
git clone https://github.com/egorshest/webgl-ascii-hero.git
cd webgl-ascii-hero

# Install dependencies
npm install

# Run the development server
npm run dev

Open http://localhost:3000 to see the effect.

Project Structure

webgl-ascii-hero/
├── app/
│   ├── layout.tsx      # Root layout
│   ├── page.tsx        # Home page
│   └── globals.css     # Global styles
├── components/
│   ├── hero.tsx        # Hero component (main page)
│   ├── effect-scene.tsx # 3D scene setup
│   └── ascii-effect.tsx # ASCII post-processing shader
└── public/
    └── models/
        └── user-model.glb   # 3D model (GLTF format) - DEMO ONLY, replace with your own

Customization

Adding Your Own 3D Model

⚠️ Important: The included user-model.glb model is for demonstration purposes only. Please remove it and use your own model.

Steps to add your own model:

  1. Download a GLB model from any source (make sure you have the rights to use it):
  2. Sketchfab - Filter by CC0 license for free models
  3. Poly Haven - CC0 models
  4. glTF Sample Models - Various licenses
  5. Or create your own using Blender, Maya, etc.

  6. Replace the demo model with your own GLB file: bash # Simply replace the demo file with your own model # Make sure your file is named "user-model.glb" and placed in public/models/ # The code already references "/models/user-model.glb", so no code changes needed!

  7. Adjust the scale if needed in components/effect-scene.tsx (line 124): tsx <UserModel scale={8} /> // Change the number to adjust size

  8. Update the component name from UserModel to match your model (optional, for clarity).

Adjust ASCII Effect

Modify the AsciiEffect props in components/effect-scene.tsx:

<AsciiEffect
  cellSize={9}              // Size of ASCII cells
  invert={true}             // Invert brightness
  color={true}              // Enable color
  characterSet="terminal"   // Character set
  volumeShading={true}      // 3D depth effect
  tintColor="#917AFF"       // Tint color
  postfx={{
    contrastAdjust: 1.8,    // Contrast
    brightnessAdjust: 0,   // Brightness
  }}
/>

Modify Scene Lighting

Edit lighting in components/effect-scene.tsx:

<ambientLight intensity={0.08} />
<directionalLight position={[2, 3.5, 6]} intensity={6} />
<directionalLight position={[-2, 1.5, 4]} intensity={0.35} />

Building for Production

npm run build
npm start

License

MIT License - feel free to use this project for your own purposes.

Credits

Extension points exported contracts — how you extend this code

AsciiEffectImplOptions (Interface)
(no doc)
components/ascii-effect.tsx
EffectSceneProps (Interface)
(no doc)
components/effect-scene.tsx
AsciiEffectProps (Interface)
(no doc)
components/ascii-effect.tsx

Core symbols most depended-on inside this repo

createGlyphTexture
called by 1
components/ascii-effect.tsx
updateResolution
called by 1
components/effect-scene.tsx
Hero
called by 0
components/hero.tsx
constructor
called by 0
components/ascii-effect.tsx
update
called by 0
components/ascii-effect.tsx
UserModel
called by 0
components/effect-scene.tsx
DraggableUserModel
called by 0
components/effect-scene.tsx
onPointerDown
called by 0
components/effect-scene.tsx

Shape

Function 17
Interface 3
Class 2
Method 2

Languages

TypeScript100%

Modules by API surface

components/effect-scene.tsx13 symbols
components/ascii-effect.tsx7 symbols
components/hero.tsx1 symbols
components/annotation-dot.tsx1 symbols
app/page.tsx1 symbols
app/layout.tsx1 symbols

For agents

$ claude mcp add webgl-ascii-hero \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page