dorkhub

Elemental-Serenity

A 3D diorama built with Three.js and custom WebGL shaders. Explore season transitions (spring, summer, autumn, winter),…

SahilK-027
JavaScript19640 forksMITupdated 1 month ago
visit the demogit clone https://github.com/SahilK-027/Elemental-Serenity.gitSahilK-027/Elemental-Serenity

Elemental Serenity

An interactive 3D nature diorama built with WebGL and Three.js.

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

npm install

Development

npm run dev

Build for Production

npm run build

Preview Production Build

npm run preview

Host on Local Network

npm run host

🎮 Debug Mode

Add ?mode=debug to the URL to enable:

  • Performance monitoring (FPS, draw calls)
  • lil-gui controls for tweaking parameters
  • Verbose console logging

🏗️ Project Structure

src/
├── main.js              # Entry point and UI initialization
├── reveal.js            # Shader-based reveal transition
├── config/              # Asset paths and configuration
├── utils/               # Console styling utilities
├── Game/
│   ├── Game.class.js    # Main game orchestrator
│   ├── Core/            # Renderer and camera setup
│   ├── UI/              # Music controls, lightning button, toasts
│   ├── Utils/           # Audio, events, resource loading, timing
│   └── World/
│       ├── Components/  # Bridge, bush, camp, fire, fog, rain, etc.
│       ├── Managers/    # Biome, grass, bush, season, environment
│       └── Systems/     # Lightning and particle systems
└── Shaders/
    ├── Chunks/          # Chunks to modify builtin shaders from three.js (grass, ground, rocks, water)
    └── Materials/       # Full shader materials (fire, fireflies, skydome, etc.)

public/
├── audio/               # Music and sound effects
├── draco/               # Draco decoder for compressed models
├── map/                 # Environment maps (day, day2, night)
├── models/              # GLB 3D models
└── textures/            # Texture assets organized by type

🛠️ Tech Stack

Layer Technology Purpose
Build Vite 6.0 Fast dev server with HMR
3D Engine Three.js 0.182 WebGL rendering
Animation GSAP 3.14 Smooth tweening and timelines
Shaders GLSL Custom visual effects
Debug UI lil-gui Runtime parameter controls
Performance three-perf FPS and draw call monitoring
Styles Sass SCSS preprocessing
RNG Mersenne Twister Deterministic randomness

📱 Mobile Support

  • Touch-friendly UI controls
  • Haptic feedback for button presses and lightning effects
  • Responsive canvas sizing

more like this

lottery

🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀

JavaScript4.6k

search

search projects, people, and tags