Skip to content

gayanukabulegoda/Billboard-Showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Billboard Showcase - 3D Billboard Experience

Babylon.js Next.js TypeScript Vercel

An immersive 3D experience showcasing dynamic billboards with video textures, interactive elements, and real-time animations.

๐Ÿš€ Live Demo


โœจ Features

๐ŸŽฌ Dynamic Video Billboards

  • Real-time video textures on 3D billboard models
  • Multiple video formats support (MP4, WebM)
  • Seamless video playback with autoplay and looping
  • Cross-browser compatibility for video rendering

๐ŸŽจ Interactive 3D Scene

  • Four distinct billboard types with unique characteristics
  • Static image billboards with high-quality textures
  • Glowing border effects with dynamic blue highlights
  • Rotating video billboards with continuous horizontal rotation
  • Click-to-inspect mesh interaction system

๐ŸŽฏ Advanced 3D Rendering

  • Professional lighting with hemispheric light setup
  • Optimized camera controls with ArcRotateCamera
  • Responsive design that adapts to all screen sizes
  • Smooth 60fps animations with efficient render loops

๐Ÿ› ๏ธ Developer Experience

  • Modular GLB loader utility for easy 3D model management
  • TypeScript support with full type safety
  • Clean architecture with separated concerns
  • Hot reload development environment

๐Ÿ—๏ธ Architecture

Core Components

src/
โ”œโ”€โ”€ components/
โ”‚   โ””โ”€โ”€ BabylonScene.tsx      # Main 3D scene component
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ glbLoader.ts          # GLB model loading utility
โ””โ”€โ”€ app/
    โ”œโ”€โ”€ layout.tsx            # App layout wrapper
    โ””โ”€โ”€ page.tsx              # Main page component

3D Assets Structure

public/
โ”œโ”€โ”€ 3D assets/
โ”‚   โ”œโ”€โ”€ billboard.glb         # Static image billboard
โ”‚   โ”œโ”€โ”€ billboardGlow.glb     # Glowing border billboard
โ”‚   โ”œโ”€โ”€ billboardForVideos.glb # Video billboard
โ”‚   โ””โ”€โ”€ billboardRotate.glb   # Rotating video billboard
โ”œโ”€โ”€ images/
โ”‚   โ”œโ”€โ”€ bad_meow_01.jpg       # Static textures
โ”‚   โ””โ”€โ”€ bad_meow_02.jpg
โ””โ”€โ”€ videos/
    โ”œโ”€โ”€ crypto_life.mp4       # Video textures
    โ”œโ”€โ”€ crazy_run.mp4
    โ”œโ”€โ”€ hehe_emoji_video.mp4
    โ””โ”€โ”€ oops_emoji_video.mp4

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ or Bun
  • Modern web browser with WebGL support

Installation

# Clone the repository
git clone https://github.com/gayanukabulegoda/Billboard-Showcase.git
cd Billboard-Showcase

# Install dependencies
npm install
# or
bun install

# Start development server
npm run dev
# or
bun dev

Production Build

# Build for production
npm run build
# or
bun run build

# Start production server
npm start
# or
bun start

๐ŸŽฎ Usage

Scene Navigation

  • Mouse drag - Rotate camera around the scene
  • Mouse wheel - Zoom in/out
  • Click on meshes - Inspect mesh details in console

Billboard Types

Billboard Type Features
Static Image textures High-quality static images
Glow Image + Effects Blue glowing borders
Video Video textures Real-time video playback
Rotating Video + Animation Continuous horizontal rotation

๐Ÿ› ๏ธ Development

Adding New Billboards

  1. Add GLB model to public/3D assets/
  2. Configure in BabylonScene.tsx:
{
  glbFile: "your-model.glb",
  textures: [
    {
      meshName: "MeshName_primitive1",
      texturePath: "/path/to/texture.jpg",
      materialName: "uniqueMaterialName",
      isVideo: false, // or true for videos
    }
  ]
}

Custom Materials

// In glbLoader.ts
if (materialName.includes("glow")) {
  material.diffuseColor = new Color3(0.0, 0.5, 1.0);
  material.emissiveColor = new Color3(0.0, 0.3, 0.8);
  // Add custom glow effects
}

๐ŸŽจ Customization

Camera Settings

const camera = new ArcRotateCamera(
  "camera",
  -Math.PI / 1.8, // Horizontal rotation
  Math.PI / 3, // Vertical angle
  15, // Distance
  new Vector3(12, 0, 0), // Target position
  scene
);

Lighting Configuration

const light = new HemisphericLight("light", new Vector3(0, 1, 0), scene);
light.intensity = 1.5; // Adjust brightness

Scene Background

scene.clearColor = new Color4(0.75, 0.75, 0.75, 1.0); // Light gray

๐Ÿš€ Deployment

Vercel

  1. Push to GitHub
  2. Connect repository to Vercel
  3. Deploy automatically

๐Ÿ“Š Performance

Optimizations

  • Efficient render loops with 60fps target
  • Texture compression for faster loading
  • LOD (Level of Detail) for complex models
  • Frustum culling for off-screen objects

Browser Support

  • โœ… Chrome 80+
  • โœ… Firefox 75+
  • โœ… Safari 13+
  • โœ… Edge 80+

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed by Gayanuka Bulegoda

โญ Star this repo โ€ข ๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Request Feature

About

An immersive 3D billboard experience built with Babylon.js and Next.js, featuring dynamic video textures, interactive billboards, and real-time animations. Showcases advanced 3D rendering with rotating video billboards, glowing effects, and responsive camera controls.

Topics

Resources

License

Stars

Watchers

Forks

Contributors