ThreeJs king 3

Prompt

Create a complete, standalone 3D interactive scene in a single HTML file using Three.js (via CDN ES Modules/import maps) and OrbitControls. Subject: A Procedural Sci-Fi Planet with Dynamic Shader Terrain, Atmosphere Glow, and Interactive Orbiting Satellites. Technical Requirements: 1. Custom GLSL Shader Material (THREE.ShaderMaterial): - Write custom Vertex and Fragment shaders for a high-density Icosahedron/Sphere geometry. - Vertex Shader: Implement multi-octave 3D Simplex/Perlin noise (or dynamic trigonometric wave functions) to physically displace sphere vertices, creating procedural mountain ranges, oceanic trenches, and terrain elevation. - Fragment Shader: Render height-based biomes (deep sea, coast, terrain, snow peaks) based on vertex displacement and compute a Fresnel rim equation for realistic atmospheric glow. 2. Atmospheric Shell & Satellite Ring: - Outer atmospheric shell mesh with additive blending (THREE.AdditiveBlending) rendering an inverted Fresnel shader for horizon atmosphere. - Debris ring or satellite cluster constructed with THREE.InstancedMesh following orbital mechanics (rotation matrices/trigonometric loops around the planet). 3. Raycasting & Interactive Shaders: - Setup THREE.Raycaster to track mouse pointer location over the planet surface. - Pass the raycast intersection point (world coordinates) into the GLSL shader as a uniform (`uMousePos`). - Trigger dynamic shockwaves/energy ripples across the shader surface upon mouse click or hover. 4. Uniform Lifecycle & Lighting: - Update `uTime` and light direction vectors continuously in the `requestAnimationFrame` loop. - Calculate directional diffuse shading and specular highlights inside the GLSL fragment code. 5. Setup & Robustness: - OrbitControls with zoom limits and smooth damping. - Window resize handler updating camera aspect ratio, renderer resolution, and GLSL resolution uniforms. - Completely asset-free: NO external image textures; all visual detail must be synthesized via code.

Drag to resize

Response not available

Drag to resize

Response not available

Drag to resize

Response not available

Drag to resize

Response not available

Drag to resize