You are an expert graphics programmer (GLSL, OpenGL, real-ti...
Prompt
You are an expert graphics programmer (GLSL, OpenGL, real-time rendering, Minecraft client development). Build a visually stunning, interactive, physically-inspired BLACK HOLE simulation that looks like "Gargantua" from the movie Interstellar. It will be used as the animated background of my custom Minecraft client's main menu. TARGET ENVIRONMENT - Minecraft Java Edition 26.2 (the new year-based versioning; unobfuscated game code, Mojang names), Java version required by that release: [WPISZ, np. 25]. - Loader / base: [WPISZ, np. Fabric / own client built on Fabric]. - In 26.2 Vulkan is the default backend. My client FORCES the OpenGL 3.3 Core Profile before window creation, so write everything for OpenGL 3.3 core: GLSL "#version 330 core" and LWJGL 3 GL33 calls. Do NOT use any legacy API (no fixed-function pipeline, no LWJGL 2, no old 1.8.9 / 1.12 patterns, no GLSL 120). - Because Minecraft renders its own GUI with OpenGL state, my renderer must be fully state-safe: save and restore the bound program, VAO, VBO, FBO, active texture and bindings, viewport, blend, depth test, cull face and scissor, so nothing in Minecraft breaks after my draw call. - IMPORTANT HONESTY RULE: you may not know the exact 26.2 internal class and method names. For the Minecraft-specific integration (Screen / TitleScreen mixin or replacement, GuiGraphics, mouse input, window size, framebuffer access) keep the layer thin, isolate it in ONE clearly marked class, use the current Mojang-mapped names only where you are certain, and add a "// VERIFY:" comment on every call you are not 100% sure exists. Never invent APIs silently. - It must run at a stable 60 FPS on a mid-range GPU and degrade gracefully on integrated GPUs. VISUAL REFERENCE (match this look closely) - A pitch-black spherical event horizon (the "shadow") in the center. - A thin, tilted accretion disk (about 10-15 degrees inclination from the camera) with warm colors: white-hot inner edge fading to orange, copper and dark brown at the outer edge. - Gravitational lensing: the far side of the disk is bent over the top and under the bottom of the black hole, forming the iconic halo / ring shape around the shadow. - A thin, bright photon ring hugging the edge of the shadow. - Relativistic Doppler beaming: the side of the disk moving toward the camera is much brighter and slightly bluer-white, the receding side is dimmer and redder. Add gravitational redshift near the horizon. - Turbulent, streaky disk texture (procedural fbm / simplex noise stretched along the orbital direction, differential rotation: inner parts rotate faster than outer parts). - Dark space background with sparse, tiny stars that are ALSO gravitationally lensed (stars near the shadow get stretched into arcs, Einstein-ring style). - Subtle post-processing: soft bloom/glow on the bright areas, light vignette, very subtle film grain, ACES or filmic tonemapping. Keep it cinematic and realistic, no oversaturated colors. TECHNIQUE - Render everything in a single full-screen fragment shader. - For each pixel cast a ray and integrate the null geodesic in Schwarzschild spacetime (use the well-known approximation of light bending, e.g. acceleration a = -1.5 * h^2 * r_vec / r^5 with h = |cross(pos, vel)|, using RK2/RK4 or adaptive step size). - Detect intersection with the accretion disk plane (between inner radius ~2.6 Rs and outer radius ~12 Rs), accumulate emission with correct ordering so the disk can be crossed multiple times (front, lensed top, lensed bottom). - Terminate the ray when it crosses the event horizon (pixel is black) or escapes (sample the lensed starfield using the final ray direction). - Add slight vertical thickness / falloff of the disk so it is not a perfectly flat sheet. - Performance: adaptive step size (smaller steps near the black hole), early exit, configurable max steps, option to render at 50% resolution into an FBO and upscale with bilinear filtering plus bloom. Provide 3 quality presets (LOW / MEDIUM / HIGH). INTERACTIVITY (main menu) - Slow automatic camera orbit when idle. - Smooth mouse parallax: camera shifts slightly following the cursor. - Hold left mouse button and drag to orbit the camera (yaw + pitch) with inertia / smooth damping. Make sure this does not conflict with clicking the menu buttons (only start dragging on empty background area). - Mouse wheel zooms in/out within sensible limits. - Soft intro animation: on opening the menu the camera slowly flies in from far away and the disk fades in. - Expose uniforms: iTime, iResolution, iMouse, camera angles, zoom, disk inclination, disk brightness, rotation speed, quality. DELIVERABLES (in this exact order) 1. A single-file HTML preview (WebGL2, no external libraries) with the full simulation, so I can test the look instantly in a browser. 2. The final GLSL 330 core shader files (vertex + fragment) for Minecraft, cleanly commented, with the physics parts briefly explained. 3. Complete Java code: ShaderProgram helper (compile, link, uniforms, error logging), BlackHoleRenderer (fullscreen triangle/quad with its own VAO, optional FBO + bloom, render(float partialTick), resize handling, close()/cleanup), and a minimal integration class for the main menu screen (draw the black hole first as background, then the normal widgets on top, forward mouse input). Show where the .vert/.frag files go in the resources folder and how they are loaded. 4. A short list of tweakable constants and what they change. QUALITY REQUIREMENTS - Output complete, copy-paste-ready, compiling code. No pseudo-code, no "..." placeholders, no omitted parts. - No GLSL mistakes for #version 330 core (in/out instead of attribute/varying, texture() instead of texture2D, declare the output color). - Prioritize how it LOOKS: breathtaking and as close to the reference as possible, while staying real-time.
Response not available
Response not available
Response not available