Skip to content

Feat/issue 10 planet shaders#39

Open
theshantanujoshi wants to merge 5 commits into
adhit-r:mainfrom
theshantanujoshi:feat/issue-10-planet-shaders
Open

Feat/issue 10 planet shaders#39
theshantanujoshi wants to merge 5 commits into
adhit-r:mainfrom
theshantanujoshi:feat/issue-10-planet-shaders

Conversation

@theshantanujoshi

Copy link
Copy Markdown

Summary

This PR implements a library of procedural climate-aware shaders for planets, addressing Issue #10. It replaces the simple colored spheres with high-fidelity, climate-specific surfaces that activate upon close zoom.

Key Changes

  • Shader Gallery: Created a new library of GLSL shaders in components/galaxy/shaders/planet/ for:
    • Desert (Tatooine): Wind-rippled dunes and twin-sun highlights.
    • Ice (Hoth): Cracked surfaces and polar auroras.
    • Ocean (Kamino): Animated waves and foam.
    • Lava (Mustafar): Glowing magma fissures and convection cells.
    • Gas Giant (Bespin): Banded turbulence and swirls.
    • Forest (Endor): Canopy noise and atmospheric haze.
    • City (Coruscant): Emissive grid lights and traffic on night-side.
  • Metadata Integration: Extended PlacedPlanet to include physical attributes from SWAPI (climate, terrain, surface water) and added a keyword-based selector to map planets to their appropriate climate shader.
  • Performance Optimization: Shaders only activate when the camera is within 80 units of a planet, gracefully transitioning back to lightweight MeshBasicMaterial at a distance.
  • UX: Respects prefers-reduced-motion by freezing animated shader uniforms.

Verification Results

  • Visuals: Verified high-detail surfaces for Tatooine, Coruscant, and Mustafar via close-up screenshots.
  • Performance: Confirmed smooth transitions and efficient rendering during galaxy navigation.
  • Lore: Shaders accurately reflect canonical planetary biomes.

Fixes #10

@safedep

safedep Bot commented May 14, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

Installation is not linked with SafeDep Tenant. Click here to optionally link your GitHub App installation with SafeDep Tenant.

This report is generated by SafeDep Github App

@adhit-r

adhit-r commented May 14, 2026

Copy link
Copy Markdown
Owner

Holding this because it inherits the #38 TypeScript failures and adds one more shader error:

components/galaxy/Planet.tsx(115,7): 'shaderMaterial.uniforms.uTime' is possibly 'undefined'.

Please guard or strongly type the uniform before assigning to uTime.value.

There is also a runtime/performance issue in the same area: ref.current.getWorldPosition(new THREE.Vector3()) allocates a new vector every frame for every planet. Please keep a reusable scratch Vector3 in a ref instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Procedural climate-shader gallery for planets

2 participants