Skip to content

YasirAwan4831/holographic-shader-visualizer-three.Js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Header Banner

React Three.js GSAP WebGL GLSL



Status License Version PRs Welcome Maintained Node.js


๐ŸŒŒ Overview

Side Banner

HOLO.SYS is a premium, high-performance interactive 3D holographic rendering engine built for the modern web. It merges cutting-edge React architecture with the raw power of Three.js WebGL, crafted with handwritten GLSL shaders to deliver a cinematic, cyberpunk-inspired visual experience directly in the browser.

This project is not just a demo โ€” it is a production-ready visualization framework with a clean, modular, and scalable React codebase. Every visual element has been engineered with precision: from the glitch-displacement vertex shader to the fresnel rim glow in the fragment shader.

"The future is holographic. Build it in the browser."



๐ŸŒ Live Demo

https://holographic-threejs.vercel.app/



๐Ÿ“ Technical Articles

Explore the complete development journey, rendering architecture, shader engineering and performance optimization behind HOLO.SYS across multiple platforms.


โœจ Key Features

๐Ÿ”ต Custom GLSL Shaders

Handwritten vertex and fragment shaders that produce:

  • Dynamic glitch displacement waves
  • Animated scanline density effect
  • Fresnel rim glow based on view angle
  • Smooth falloff for holographic transparency

โšก Glitch Effects

Multi-layered glitch engine with:

  • Time-based sine wave displacement

  • Progress-driven transition glitch band

  • Randomized X/Z axis displacement

  • Smooth step blending for natural look

๐Ÿ”„ Seamless Object Transitions

GSAP-powered sweep transitions:

  • Bottom-to-top progress masking
  • Simultaneous current/next mesh rendering
  • Auto-cycling through 3 geometry shapes
  • Configurable transition duration & easing

๐ŸŽ›๏ธ Interactive HUD Overlay

Cyberpunk UI built into the React component:

  • Real-time system status indicators

  • Animated blinking status dots

  • Corner bracket decorations

  • Scanline screen overlay effect

๐Ÿ’ก Dynamic Lighting System

  • Ambient light (scene fill)

  • Directional light (shape definition)

  • Point light (colored glow under object)

  • All colors editable via GUI in real-time

๐ŸŽจ Live GUI Controls

Using lil-gui panel:

  • Hologram color picker

  • Stage platform color

  • Ambient light color

  • Directional light color

๐Ÿš€ Performance Optimized

  • requestAnimationFrame loop

  • DPR capped at 2x for GPU efficiency

  • Proper geometry/material disposal

  • Memory leak prevention on unmount


๐Ÿ—‚๏ธ Project Architecture

holographic-shader-react/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ public/
โ”‚   โ””โ”€โ”€ index.html                    โ† HTML entry point
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ HologramScene/
โ”‚   โ”‚       โ”œโ”€โ”€ HologramScene.jsx     โ† 3D Canvas + Cyberpunk HUD Overlay
โ”‚   โ”‚       โ””โ”€โ”€ index.js              โ† Barrel export
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ shaders/
โ”‚   โ”‚   โ”œโ”€โ”€ vertexShader.glsl.js      โ† Glitch + Displacement Shader
โ”‚   โ”‚   โ””โ”€โ”€ fragmentShader.glsl.js   โ† Scanlines + Fresnel + Masking
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ hooks/
โ”‚   โ”‚   โ””โ”€โ”€ useHologram.js            โ† All Three.js scene logic
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/
โ”‚   โ”‚   โ””โ”€โ”€ threeHelpers.js           โ† Factory functions (renderer, lights, etc.)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ constants/
โ”‚   โ”‚   โ””โ”€โ”€ params.js                 โ† Centralized config & defaults
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ styles/
โ”‚   โ”‚   โ””โ”€โ”€ globalStyles.js           โ† CSS-in-JS global styles
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ App.js                        โ† Root component
โ”‚   โ””โ”€โ”€ index.js                      โ† React DOM entry point
โ”‚
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Tech Stack

Technology Version Purpose
React 18.2 UI framework, component lifecycle, hooks
Three.js r160 WebGL abstraction, 3D scene & meshes
GLSL ES 3.0 Custom vertex & fragment shader programs
GSAP 3.12 High-performance animation & transitions
lil-gui 0.19 Floating control panel for live tweaking
OrbitControls r160 Interactive camera rotation, zoom, pan
WebGL 2.0 GPU-accelerated 3D rendering in browser

๐Ÿš€ Getting Started

Prerequisites

Make sure you have the following installed:

  • โœ… Node.js v16 or higher
  • โœ… npm v8+ or yarn v1.22+
  • โœ… A modern browser with WebGL 2.0 support (Chrome, Firefox, Edge)

Installation

1. Clone the repository:

git clone https://github.com/YasirAwan4831/holographic-shader-react.git
cd holographic-shader-react

2. Install all dependencies:

npm install
# or
yarn install

3. Start the development server:

npm start
# or
yarn start

4. Open in your browser:

http://localhost:3000

The app will automatically reload whenever you save a file.


Build for Production

npm run build
# or
yarn build

The optimized production build will be generated in the /build folder, ready to deploy on Vercel, Netlify, or GitHub Pages.


๐ŸŽฎ Controls

Action Input
๐Ÿ”„ Rotate Camera Left click + Drag
๐Ÿ” Zoom In / Out Scroll wheel
โœ‹ Pan Camera Right click + Drag
๐ŸŽจ Change Colors Top-right GUI Panel
๐Ÿ’ก Adjust Lighting Top-right GUI Panel

โš™๏ธ GUI Panel Controls

Open the top-right control panel in the app to adjust in real-time:

Control Description
๐ŸŽจ Hologram Color Change the hologram shader tint (default: #00d5ff)
๐ŸŸ๏ธ Stage Color Change the platform / pedestal color
โ˜€๏ธ Ambient Light Adjust the ambient scene light color
๐Ÿ’ก Directional Light Adjust the key directional light color

๐Ÿ”ฌ Shader Details

Vertex Shader โ€” vertexShader.glsl.js

The vertex shader controls glitch displacement in 3D space:

// Base glitch using time-based sine wave
float glitchStrength = sin(glitchTime) * sin(glitchTime * 3.45) + sin(glitchTime * 8.76);
glitchStrength = smoothstep(0.5, 1.0, glitchStrength) * 2.0;

// Random X/Z axis displacement
modelPosition.x += (random(modelPosition.xz + uTime) - 0.5) * glitchStrength;
modelPosition.z += (random(modelPosition.xz + uTime) - 0.5) * glitchStrength;

Fragment Shader โ€” fragmentShader.glsl.js

The fragment shader renders the holographic visual effect:

// Scanline pattern
float density = pow(mod(offset * 20.0, 1.0), 3.0);

// Fresnel rim glow based on view angle
float fresnel = pow(1.0 - abs(dot(normalize(vNormal), viewDirection)), 2.0);

// Combined holographic output
float holographic = density * fresnel + fresnel * 1.25;
gl_FragColor = vec4(uColor, holographic * falloff);

๐Ÿ“ฆ Dependencies

{
  "react": "^18.2.0",
  "react-dom": "^18.2.0",
  "three": "^0.160.0",
  "gsap": "^3.12.4",
  "lil-gui": "^0.19.2"
}

๐Ÿ”ฎ Roadmap & Future Enhancements

  • ๐ŸŒธ Add post-processing bloom effect for intense neon glow
  • ๐ŸŽต Audio-reactive glitch effects using Web Audio API
  • ๐Ÿงฌ Support for custom GLTF / GLB 3D model loading
  • ๐Ÿ“ฑ Optimize touch controls for mobile devices
  • ๐ŸŒ Add WebXR support for VR/AR hologram viewing
  • ๐ŸŽญ Add more geometric shapes (Klein Bottle, Mobius Strip, etc.)
  • ๐Ÿ’พ Save & share color presets via URL parameters
  • โšก Add Suspense-based lazy loading for 3D assets

๐Ÿ‘จโ€๐Ÿ’ป Author


Author

Portfolio ย  GitHub


๐Ÿ“„ License

MIT License โ€” Copyright (c) 2026 Muhammad Yasir Awan 

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files, to deal in the Software
without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense and/or sell copies of the
Software.

Footer
Development By โค๏ธ Muhammad Yasir Awan

About

A futuristic real-time 3D holographic visualization built using Three.js, GLSL shaders, GSAP animations and WebGL rendering techniques. This project features hologram scan lines, glitch effects, dynamic object transitions and interactive controls inspired by cyberpunk and sci-fi interfaces.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors